开发者

How to disable all buttons in Java, Android

开发者 https://www.devze.com 2023-04-09 15:52 出处:网络
I create an app which need to disa开发者_StackOverflow中文版ble all buttons to allow user to leave the application - back button, menu button, camera button, call button, etc, and app should have 1 bu

I create an app which need to disa开发者_StackOverflow中文版ble all buttons to allow user to leave the application - back button, menu button, camera button, call button, etc, and app should have 1 button for exit. I don't know how to disable all buttons. Tell me please, thank you


The Physical buttons? No, you can't disable all of them. Home button needs to work... Android - Is It possible to disable the click of home button

Related: Android: mass enable/disable buttons


Try this: when you enter the activity, call

getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);

and when you exit the activity, call

getWindow().setType(WindowManager.LayoutParams.TYPE_APPLICATION);
0

精彩评论

暂无评论...
验证码 换一张
取 消