2

I am displaying data in recylerView. So if user click on items ( any row ), New activity will be open. It is working fine using below link.

RecyclerView onClick

But Row is also contains button. When i am clicking on button. it is opening activity but it should not call RecyclerItemClickListener. I noted my both listener invoked at the time of button click. 1) RecyclerItemClickListener 2) setOnClickListener

I am trying to find a way so when user will click on button. it should only call setOnClickListener not RecyclerItemClickListener .

This is Code

https://codeshare.io/p80NU

kindly have a look at.

Community
  • 1
  • 1
user1629977
  • 437
  • 1
  • 5
  • 21
  • Can you share your code. Try to set same click listener for the views and in onClick check for id using view.getId() and do your operation accordingly. – Drup Desai May 31 '16 at 06:58
  • Please check update – user1629977 May 31 '16 at 07:05
  • I guess your Floating action bar is not consuming the touch, in android Touch framework, a touch is propagated from parent view to child view and if child does not consume it will go back to the parent view. in your case I have reason to believe that your RecyclerView consumes the touch so your inner row is not getting the touch event – Pankaj Nimgade May 31 '16 at 07:30

1 Answers1

0

you are calling two event at the same time so that it may be conflict. use OnClicklistener in adapter class. for Button click use onclicklistener on button. For Item click use onclicklistener on your adapterview.

go through this link http://androidheight.blogspot.in/2015/03/recyclerview-widget-example-in-android.html

Prabhakar
  • 1,781
  • 1
  • 17
  • 23