0

I currently have a Floating Action Buttons that will record some speech when held down. Once the Button is released I would like a particular row on a ListView to show a play Button.

I have the index of the row in a variable named "selected". But I do not know how to make the ImageButton on that row visible from within the FAB.OnClickListener. Any suggestions?

Thanks

Igor Fridman
  • 1,267
  • 1
  • 16
  • 30
Greg Jones
  • 28
  • 6
  • see the accepted answer on this https://stackoverflow.com/questions/3724874/how-can-i-update-a-single-row-in-a-listview – Vivek Mishra Nov 13 '17 at 10:03

1 Answers1

0

If you want only one item of your list view to show the play button put a variable int playButtonPosition = -1 in your adapter.

In getView method of your adapter, check if (position == playButtonPosition) and show your button here.

In FAB.OnClickListener update adapter.playButtonPosition = selected and notify your adapter about the changes adapter.notifyDataSetChanged().