title: Keep textview content in listview scrolling
body: <p>I have read about this confusing material, "listview scrolling lost content" and It made me frustrated. So I decide to ask here. Here is what I need:</p>
  
  <pre><code>(TextItems)  (TextValue)
  Item1            0 
  Item2            0
  Item3            0
  // after input custom edittext dialog, It must be:
  Item1            3
  Item2            8
  Item3            5
  </code></pre>
  
  <p>But, after I scroll down my screen(3 items isnot displayed on screen) then sroll up again, those item values is back to 0. Here is my Main.java:</p>
  
  <pre><code>String[] items = {"Item1","Item2","Item3","Item4",..,"Item30"};
  
  final ListView listView = (ListView)findViewById(R.id.listItems); 
  ArrayAdapter&lt;String&gt; adapter = new LVAdapter(this, items);
  listView.setAdapter(adapter);
  
  listView.setOnItemClickListener(new OnItemClickListener() {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, final View view,
                      int position, long id) {
  
                  AlertDialog.Builder alert = new AlertDialog.Builder(Main.this);
                  LayoutInflater inflater = Main.this.getLayoutInflater();
                  View v = inflater.inflate(R.layout.input_dialog, null);
                  alert.setView(v);
  
                  final EditText userInput = (EditText)v.findViewById(R.id.editInput);
                  alert.setPositiveButton("OK", new DialogInterface.OnClickListener() {
  
                      @Override
                      public void onClick(DialogInterface dialog, int which) {
                          TextView tv = (TextView)view.findViewById(R.id.textValue); // for giving value on each Items
                          tv.setText(userInput.getText());
                      }
                  });
  
                  AlertDialog al = alert.create();
                  al.show();
              }
          });
  </code></pre>
  
  <p>Then, its my LVAdapter.java</p>
  
  <pre><code>public class LVAdapter extends ArrayAdapter&lt;String&gt; {
  
  private final Context context;
  private final String[] val;
  
  public LVAdapter(Context context, String[] val) {
      super(context, R.layout.detail_item, val);
      this.context = context;
      this.val = val;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
  
      LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View v = inflater.inflate(R.layout.detail_item, parent, false);
  
      TextView tv = (TextView)v.findViewById(R.id.textItems); //for storing Item1, Item2, .., etc.
      tv.setText(val[position]);
  
      return v;
  }
  </code></pre>
  
  <p>Main.xml</p>
  
  <pre><code>&lt;ListView
      android:id="@+id/listItems"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:descendantFocusability="afterDescendants" &gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>And Its main_items.xml</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;TextView
          android:id="@+id/textItems"
          android:layout_width="250dp"
          android:layout_height="wrap_content"
          android:text="TextView"
          android:layout_alignParentLeft="true"
          android:padding="5dp"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  &lt;!-- I need to set this textView based on users input --&gt;
      &lt;TextView
          android:id="@+id/textValue"
          android:layout_width="60dp"
          android:layout_height="wrap_content"
          android:gravity="center"
          android:layout_alignParentRight="true"
          android:text="0"
          android:padding="5dp"
          android:textAppearance="?android:attr/textAppearanceMedium" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Here I am. Stack in how to implement "what is it called" for keeping my value, even I srolling my screen. Thanks in advance.</p>