How to populate a String Array from a JSONObject to use in a ListView
<p>I have an android/java task where I want to get JSON values into a String array to display in a ListView and I am not sure where to begin? Thanks.          </p>

<pre><code>private String[] values;
...
// this is what is returned from the web server (Debug view)
// jObj = {"success":1,"0":"Mike","1":"message 1","2":"Fred","3":"message 2","4":"John","5":"message 3"};

try {
   if (jObj.getInt("success") == 1) {
      .
      // what i'm trying to do here is iterate thru JObj and assign values to the 
      // values array to populate the ArrayAdapter so that the ListView displays this:
      //
      // Mike: Message 1
      // Fred: Message 2
      // John: Message 3
      //
      .
      this.setListAdapter(new ArrayAdapter&lt;String&gt;(
         this, android.R.layout.simple_list_item_1, android.R.id.text1, values));
      ListView listView = getListView();
   }
}
catch (JSONException e) {
   Log.e(TAG, e.toString());
}
</code></pre>
