I have encountered a problem where user will exit my application accidentally. I know Android is preventing to block use of these buttons, because you should always be able to exit your app somehow but I am creating an app for blind and visually impaired people and I will implement a special exit the app so they won't close it when they will be using it.
Here are some things I gathered:
I can block the
onBackPressed()
function and prevent going back.I can't use
onKeyEvent()
since it won't grab the home clickGood example is MX Player where you can "lock" your screen but it just draws over the whole screen, thus preventing user to click on anything.
Ok, so I would like to grab the same thing as MX Player, except, I would like for user, to still have interaction with the screen.
I tried using Immersive full screen
that Google has introduced for full screen apps, but whenever user slides his finger on the screen, Navigation Menu
popus up. Can I keep this hidden at all times? Also, can I prevent the slide from Status Bar
to display the buttons? I would like to have full control of how the user is moving their finger over the screen.
So if I go back to the MX Player solution - drawing over the screen. Can I create like a Canvas
that doesn't have focus and it's just there to prevent the clicks on the buttons?
Any help is very much appreciated. Thanks.