When you turn it off, do you mean pressing the back button or the Home button? The back push button can be handled by overriding OnBackPress, but there is nothing you can do about the Home button.
I feel like you are still a beginner on Android. The startup and full-screen display you mentioned are functions already provided by the system. I think you will know this from Baidu. In addition, the closing of Activity is controlled by the App itself, not to mention that you have already started it and displayed it in full screen. As long as you don’t close it yourself, users naturally cannot open other applications to close it.
I had an idea before - startActivity itself during onPause. Facts have proved - this is really a deadlock! Unless you kill the process directly, you will not be able to exit whether it is home or back
When you turn it off, do you mean pressing the back button or the Home button? The back push button can be handled by overriding OnBackPress, but there is nothing you can do about the Home button.
Be a launcher
Block Activity onkeydown
I feel like you are still a beginner on Android. The startup and full-screen display you mentioned are functions already provided by the system. I think you will know this from Baidu.
In addition, the closing of
Activity
is controlled by the App itself, not to mention that you have already started it and displayed it in full screen. As long as you don’t close it yourself, users naturally cannot open other applications to close it.Intercept back event
It can be achieved using hook technology, but the phone needs root permissions
I had an idea before - startActivity itself during onPause. Facts have proved - this is really a deadlock! Unless you kill the process directly, you will not be able to exit whether it is home or back