1

I am working on a project and I was wondering how can I implement like button(custom) in list view. it should append likes for the particular row whenever like button is pressed and unlike it if pressed for second time.just like face book.

can anyone provide me link to such tutorial?? I also want to know how to handle back end part.. please suggest something. thank you.

Shelby
  • 81
  • 1
  • 11
  • http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons – DroidAks Sep 30 '15 at 06:09
  • First do a google search for tutorial on how to implement list view(you can also go for recycler view) with custom adapter...understand it properly then implement the way you want... – Shadow Droid Sep 30 '15 at 06:43

1 Answers1

0

In your custom adapter's getView() you need to add a method as setOnClickListener() for the buttons you're using.

Any data associated with the button has to be added with myButton.setTag() in the getView() and can be accessed in the onClickListener via view.getTag()

DroidAks
  • 327
  • 2
  • 9