Android-ListView:delete a custom item when the button in it get clicked?

The method getSelectedItemPosition() only returns the right value if the list item is really selected. If you press a Button inside the list item the list item probably won't be selected according to the list view. Check the value of the index Variable after you have called getSelectedItemPosition() .

If it is -1 no list item is selected and you have to do the selection of the right list item yourself.

Set an OnItemClickListener on your listview to store the item position into a field then you will know which item was selected.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions