title: can not get all the values from arraylist in android
body: <p>I want to get one by one value from arraylist and set those to <code>TextView</code>, but I could not.
  My code is :</p>
  
  <pre><code>try {
          // Getting Array of Contents
          jsonArrar = json.getJSONArray(TAG_CONTENTS);
  
          // looping through All Contents
          for(int i = 0; i &lt; jsonArrar.length(); i++){
              JSONObject c = jsonArrar.getJSONObject(i);
              list = new ArrayList&lt;String&gt;();
  
              String id1=jsonArrar.getJSONObject(i).getString(TAG_ID);                
  
              list.add(id1);
          }
  
          Iterator&lt;String&gt; iterator = list.iterator();
          builder = new StringBuilder();
          while (iterator.hasNext()) {
              String string = iterator.next();                
              builder.append(string+"\n");
  
          }
  
          textView.setText(builder);
  </code></pre>
  
  <p>in above way i only get the last value any one is welcome for telling about it.</p>