下面的代码将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