下面的代碼將json返回到textView。如何將此文本視圖中的數據傳遞給其他活動?將JSON傳遞給新的活動 - Android應用程序
private void showJSON(String response){
String name="";
String address="";
String vc = "";
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray result = jsonObject.getJSONArray(Config.JSON_ARRAY);
JSONObject collegeData = result.getJSONObject(0);
name = collegeData.getString(Config.KEY_NAME);
address = collegeData.getString(Config.KEY_ADDRESS);
vc = collegeData.getString(Config.KEY_VC);
} catch (JSONException e) {
e.printStackTrace();
}
textViewResult.setText("Name:\t"+name+"\nAddress:\t" +address+ "\nVice Chancellor:\t"+ vc);
}
這是我所關注的tutorial link。我知道這可以使用intent來完成,但我不確定如何在這個例子中使用它。
感謝
什麼問題? –
如何將我在TextView中的數據傳遞給其他活動? – Mkuuu7
使用intents和putExtra – Orphamiel