I have a ListView
which is :
<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" />
And there is ImageView
<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" />
How I am adding data in my listview.
ArrayAdapter<String> adapter = new ArrayAdapter<String>(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<?> parent, View view,
int position, long id) {
}
});
I am trying to update the listview value :
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());
But this is not changing the value
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