Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's perhaps a good time to switch to an <a href="http://developer.android.com/reference/android/widget/ArrayAdapter.html" rel="nofollow noreferrer">ArrayAdapter</a>. I recommend to transfer the JSON into a custom model bean first:</p> <pre><code>class Person { long id; String phone, name, age; } </code></pre> <p>Then you can use an JSON parser library like <a href="https://code.google.com/p/google-gson/" rel="nofollow noreferrer">gson</a> to parse the array into a <code>List&lt;Person&gt;</code> and use this array to drive your list. (See <a href="https://stackoverflow.com/questions/6932332/gson-help-with-parse-array-works-without-array-but-wont-with-array">Gson help with parse array - works without array but won&#39;t with array</a>) for an example on the parsing.</p> <p>Finally, when you are ready to write back the data, simply re-generate the JSON from the array. This question got an example for that: <a href="https://stackoverflow.com/questions/5813434/trouble-with-gson-serializing-an-arraylist-of-pojos">Trouble with Gson serializing an ArrayList of POJO&#39;s</a></p> <p>Pros:</p> <ul> <li>Once your JSON data model changes, only a small change in your model is needed to read the new format.</li> <li>You can use standard Java tools like ArrayList and POJOs</li> </ul> <p>Cons:</p> <ul> <li>You will need to import GSON or equivalent into your project. <ul> <li>Also check this question: <a href="https://stackoverflow.com/questions/9605913/how-to-parse-json-in-android">How to parse JSON in Android</a></li> </ul></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload