Display Student Details In Text View After Validation In Android
This is my previous question: display result of json data in textview of android And this is json result: {'can_data':[{'name':'dfsdfd','address':'gdgfsdf','course':'dfdfdsf'}]}
Solution 1:
If you want to parse the above json then here it is.
Send the response as putExtra to your IMEI_Val.java activityClass.
To fetch the details,
try {
JSONObject responseObject = newJSONObject(jsonObject);
JSONArray canData = responseObject.getJSONArray("can_data");
JSONObject canDataJSONObject = canData.getJSONObject(0);
String name = canDataJSONObject.getString("name");
String address = canDataJSONObject.getString("address");
String course = canDataJSONObject.getString("course");
} catch (JSONException e) {
e.printStackTrace();
}
You can set it to your text view now.
Post a Comment for "Display Student Details In Text View After Validation In Android"