1

JSON responce is

{"DbList":[{"DataBaseName":"BRISBANE","UserID":"1","WebAdmin":true},{"DataBaseName":"CENTRES","UserID":"100001","WebAdmin":true},{"DataBaseName":"MEL","UserID":"1","WebAdmin":true},{"DataBaseName":"NSW","UserID":"10001","WebAdmin":true},{"DataBaseName":"OPERATORS","UserID":"1","WebAdmin":true},{"DataBaseName":"TEST","UserID":"1","WebAdmin":true},{"DataBaseName":"WA","UserID":"1","WebAdmin":true}]}

i want to print on database names in another activity in listview plz help Thanks in advance

1
  • Add android tag also. Will get quick response. Commented Jan 6, 2012 at 6:10

1 Answer 1

2

JSON response is already in String format so you can just pass it to the next Activity as you are passing String to the next Activity using intent.putExtra("JSON", response.toString());. Then you can just get the values on the next Activity and display them.

To display data in the ListView just fetch the data from JSON response and add them to ArrayList<String> and just bind the ArrayList with the Adapter of the ListView.

Sign up to request clarification or add additional context in comments.

2 Comments

ArrayAdapter<String> dbName = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1); for(Integer i=0; i< valArray.length(); i++){ try { String obj = valArray.getJSONObject(i).getString("DataBaseName"); dbName.add(obj); } catch (JSONException e) { e.printStackTrace(); } } setListAdapter(dbName); But im getting null in ArrayAdabter so can plz help me im not getting proper result thanks in advance plz help me
yes now you can pass your dbName instance to ListView to populate it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.