Thursday, 12 September 2013

Loading Http Get JSON Result sets in List View and RelativeView

Loading Http Get JSON Result sets in List View and RelativeView

Hi I'm new to java and software development as a whole and I've been
trying to get a particular piece of code working. loading an HttpGET JSON
result set in listView, RelativeView, and GridView alternatively. I was
hoping to get a little help on how to do this for all three views. any
help and or reference link pointing me in the right direction would be
greatly appreciated.
here's a snippet of the line of code related to the output.
protected void onPostExecute(String file_url) {
// dismiss the dialog after getting all patients
pDialog.dismiss();
// updating UI from Background Thread
runOnUiThread(new Runnable() {
private SimpleAdapter adapter;
public void run() {
/**
* Updating parsed JSON data into ListView
* */
adapter = new SimpleAdapter(
VitalsActivity.this, ehrheader,
R.layout.patient_ehr_header, new String[] { TAG_EMRID,
TAG_PNAME, TAG_PTHUMB, TAG_AGE, TAG_GENDER,
TAG_MARITALSTATUS,
TAG_HEALTHCARESTATUS, TAG_ADDRESS, TAG_PHONE, TAG_MOBILE,
TAG_BLOODTYPE, TAG_HRFACTOR },
new int[] { R.id.emr_ID, R.id.ehr_ID, R.id.patient_name,
R.id.patient_thumbnail,R.id.age,
R.id.gender, R.id.marital_status, R.id.healthcare_status,
R.id.address_location,
R.id.phone_number, R.id.mobile_number, R.id.blood_type,
R.id.hr_factor});
// updating list view
}
});
}
}
}

No comments:

Post a Comment