I have a listview populated using a String array as follows:
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getListView().getContext(),android.R.layout.simple_list_item_1,res);
getListView().setAdapter(adapter);
I want to change the contents of listview using OnItemClickListener.
Depending on how you want to make changes, do you want the user to make changes by giving input or you want to make changes through code directly. The following setOnItemClickListener set the new values to the variable. For taking input from the user, you need to populate it in the fragment or new activity, take the input from the user and commit those changes, refresh the list and show the updated data.
Model class:
Adapter class:
Activity class: