Reputation: 135
I am developing an Android application for the deaf and blind using the accessibility service
Need to disable the touch screen, because android app is controlled through a third-party device
I tried to add a view to WindowManager and disable everything there (FLAG_NOT_FOCUSABLE
, FLAG_NOT_TOUCHABLE
), but as far as I understand, it disabled the touch screen only in this view, but not at all
I can request any type of permission except the root
EDIT:
Due to Android security, disabling the touchscreen is not possible without root, but you can use Proximity Sensor to disable touchscreen until first power button pressure
Upvotes: 1
Views: 3663
Reputation: 18538
Congratulations and good will for you are working for a good cause.
Not sure exactly how to do this but One way is to create a full screen activity - hide navigation bar and soft navigation buttons also -- please refer this documentation
And 2. override onBackPressed and never allow it to call super.onBackPressed() or relaunch your app in OnPause() method.
Hope this helps somewhat.
Upvotes: 0