android - Overriding the funcationality of home button -


in android have been able override funcationality of button app need override home button. sure can done how can achieve this.

@override public void onattachedtowindow() {     this.getwindow().settype(windowmanager.layoutparams.type_keyguard);     super.onattachedtowindow(); } 

and then

@override public boolean onkeydown(int keycode, keyevent event) {    if(keycode == keyevent.keycode_home)     {      log.i("home button","clicked");     }    if(keycode==keyevent.keycode_back)    {         finish();    }  return false; }  

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -