• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Android-RecyclerView OnFling gesture gets null MotrionEvent when combined with ItemOnClick

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


In the following code i have a recycler view with a custom adapter. Each item in adapter has onclick listener. Also recycler implements OnFling Gesture.

The problem
Each time OnFling gets called, the MotionEvent e1 is null. I found out this is because of the onItemClick implementation in adapter. It consumes the down click.

How can i solve this? I want to pass down to recycler the event, so the MotionEvent e1 to not be null.

MainActivity

Adapter
 
Bartender
Posts: 668
15
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not really sure what you are trying to do with all of those actions, but you could possibly change the the type of listener you are using.  Maybe there's a listener that will handle both types of actions.  It seems like the problem is that there is one event for two listeners and one of them does it only?
reply
    Bookmark Topic Watch Topic
  • New Topic