set string value into text android
I have tried to get jason data just like following way,
public void jasonParser(){
// Creating JSON Parser instance
JASONParser jParser = new JASONParser();
// getting JSON string from URL
JSONObject json = jParser.getJSONFromUrl(url);
try {
// Getting Array of Contacts
contacts = json.getJSONArray(TAG_RESULT);
// looping through All Contacts
for(int i = 0; i < contacts.length(); i++){
JSONObject c = contacts.getJSONObject(i);
// Storing each json item in variable
String latitude = c.getString(TAG_LONGITUDE);
String lognitute = c.getString(TAG_LATITUDE);
String storeid = c.getString(TAG_STOREID);
String storename = c.getString(TAG_STORENAME);
String logo = c.getString(TAG_LOGO);
String city = c.getString(TAG_CITY);
String distance = c.getString(TAG_DISTANCE);
String num = c.getString(TAG_NUM);
//int distanceIntVlue=Integer.parseInt(distance);
distanceSecond=(TextView)findViewById(R.id.placesecond);
//if(distanceIntVlue<200){
distanceplace.setText(storename);
}
Jason data get. I debugged. but settext method is not debugged. Can't set
the text. pls help me.
No comments:
Post a Comment