Android: GestureDetector not working (gestureDetector.onTouchEvent(event) always false) with Tabs (TabActivity, Tabwidget)

前端 未结 2 1380
耶瑟儿~
耶瑟儿~ 2021-02-14 02:53

I have implemented my TabActivity with different child activities:

intent = new Intent().setClass(this, MyChildTabActiviy.class);
// Initialize a TabSpec for eac         


        
相关标签:
2条回答
  • 2021-02-14 03:07

    Have a look at the answer mentioned here. He's pretty much done the same thing as you, but if you look at the first comment on the highest rated answer, Cdsboy got it working by implementing OnDown and returning true. I'm not sure why that is needed, but it worked for me.

    0 讨论(0)
  • 2021-02-14 03:10

    As a complement to @Abhinav 's answer (that btw helped me too), I'd like to say that I think overriding onDown() is needed because its default implementation in SimpleOnGestureListener is to return false. Being ACTION_DOWN the first one to reach the listener, it would make it discard the event, whatever it is.

    0 讨论(0)
提交回复
热议问题