I am trying to add an viewSwicther to a listview. What I want is that when an item is clicked for a long time, that field will be transformed to an EditText. At the moment it's always the element at the top of the list that tranforms from TextView to EditText. I have a custom adapter based on an baseAdapter.
The code is shown below;
listView.setOnItemLongClickListener(new OnItemLongClickListener(){
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
int size = findSizeOfArray();
if(position == (size-1)){
ViewSwitcher switcher = (ViewSwitcher)findViewById(R.id.my_switcher);
switcher.showNext();
preAdapter.notifyDataSetChanged();
}
return true;
}
});
preAdapter.notifyDataSetChanged();