I have an app which uses geofire to identify if the user enters the designated boundaries and when the it is true, the user's phone will be temporarily disabled in which touch functionality will be disabled.Otherwise, it will be enabled if the user leaves the assigned boundaries.Anyone can help?It would be my pleasure to hear your thoughts. Thank you!
Asked
Active
Viewed 182 times
2 Answers
1
If you want to disable the current activity then you can dispatchTouchEvent(). Example of using it:
private var inRange = false
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (!inRange)
return super.dispatchTouchEvent(ev);
return true;
}
If that's not what you are looking sorry, can you explain it a bit more?

Pang
- 9,564
- 146
- 81
- 122

bhavya_karia
- 760
- 1
- 6
- 12
-
im trying to disable the touch whereas the user can't scroll or go to the notification bar/status bar? – RoViel Oct 02 '18 at 02:19
-
To prevent the user from going to notification bar/ status bar you can check this out [link](https://stackoverflow.com/questions/25284233/prevent-status-bar-for-appearing-android-modified) – bhavya_karia Oct 03 '18 at 09:46
0
I think you can make a service that create an transparent overlay then you disable on click for this overlay .. you can see this link for more details about this solution How do I make my full-screen overlay remain full-screen after orientation changes?

Mohamed Saleh
- 141
- 6