title: Set value and Get the values of all the items in the listview Android
body: <p>I have a <code>ListView</code> which is :  </p>
  
  <pre><code>&lt;ListView
          android:id="@+id/list"
          android:layout_width="290dp"
          android:layout_height="166dp"
          android:layout_marginLeft="5dp"
          android:layout_marginTop="10dp"
          android:visibility="gone"
          android:choiceMode="singleChoice" /&gt;
  </code></pre>
  
  <p>And there is <code>ImageView</code></p>
  
  <pre><code>&lt;ImageView
          android:id="@+id/cont"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:layout_marginLeft="20dp"
          android:layout_marginTop="30dp"
          android:src="@drawable/img" /&gt;  
  </code></pre>
  
  <p>How I am adding data in my listview.</p>
  
  <pre><code>  ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, android.R.id.text1, list);
              listView.setAdapter(adapter);
              listView.setOnItemClickListener(new OnItemClickListener() {
                  @Override
                  public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                          int position, long id) {
  
  
                  }
              });
  </code></pre>
  
  <p>I am trying to update the listview value :</p>
  
  <pre><code>View v=listView.getChildAt(position);
                      TextView tv= (TextView) v.findViewById(android.R.id.text1);
                      tv.setText(firstNameDialog.getText().toString().trim().toString()+" "+lastNameDialog.getText().toString().trim().toString());
  </code></pre>
  
  <p>But this is not changing the value</p>
  
  <p>I want that when the image view is clicked then I can get the values of the listview item to get stored in the form of array. How could i get all the items values of a listview and how could set the values again on the clicked item </p>