In my app I want to detect the swipes done by user by using GestureEvent
method with OnTouchEvent
method.The OnTouchEvent
works only in activity class when I try to implement it in service class it doesn't implement.How to implement onTouchEvent in service class. Please help me.
Asked
Active
Viewed 122 times
-1

Adarsh
- 45
- 1
- 6
1 Answers
1
I don't think it is possible. You should handle the GestureEvent in the activity and implement some sort of communication between your activity and the service.
This might help you: https://stackoverflow.com/a/29101448/2442831
-
but then how OmniSwipe or LazySwipe like apps work . – Adarsh Jul 31 '16 at 13:00
-
these are widgets https://developer.android.com/guide/topics/appwidgets/index.html – Lino Jul 31 '16 at 13:06