android - How to handle home button click event in custom lock screen application -


i working in project custom lock screen must implemented once user clicks lock button. after clicking, application should locked , should prevent closing app while pressing home button. used following code disable home key pressed state:

@override     public void onattachedtowindow(){          log.i("teste", "onattachedtowindow");         this.getwindow().settype(windowmanager.layoutparams.type_keyguard);         super.onattachedtowindow();      }     public boolean onkeydown(int keycode, keyevent event){     if (keycode == keyevent.keycode_home) {         log.i("teste", "botao home");         return true;     } 

the problem above method not working latest versions. helpful if mentor me alternative solutions achieve task. in advance

you can not override home key button.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -