how to disable home button in android?

前端 未结 4 1889
太阳男子
太阳男子 2020-11-28 13:14

i want to disable android device home button when my app runs.

i have tried following code but it din\'t help :

@Override
    public bo         


        
4条回答
  •  一向
    一向 (楼主)
    2020-11-28 13:46

    I think this can be done in another style if suits your requirement. By creating your activity as home activity. If you want to disable home button and show your custom application activity as launcher when home button is pressed. Just add these lines in manifest for that activity for which you want your launcher.

    
                 
                    
    
                    
                    
    
                
    
    

    After adding and run your application. if user presses the home button, Android will ask for which launcher you want your home. Then your have to select your application launcher ALWAYS not ONLY ONCE.

    if you want fully disable the user, so that he cant move to another screen then set theme to fullscreen with NoTitlebar.

提交回复
热议问题