Sunday, 19 May 2013

Physical back key of device in Android


public boolean onKeyDown(int keyCode, KeyEvent event)
       {
              if ((keyCode == KeyEvent.KEYCODE_BACK))
              {
                     keyCode=KeyEvent.KEYCODE_1;
                     //code here....
              }
              return super.onKeyDown(keyCode, event);
       }