I Am a New Android Developer, I know Handle The Back Button but I Don't Know How To Handle Home Button, when I Clicked Home Button, I Tried a Lot Of Methods, But Not Used, Please Any One Help To Me and Solve My Problem. I have used following code,
@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if(keyCode==KeyEvent.KEYCODE_HOME)
{
Toast.makeText(this, "Click Home ", Toast.LENGTH_LONG).show();
}
return super.onKeyDown(keyCode, event);
}
You Does not get Home Button click event
.But When u press Home Button
call this method
@Override
protected void onStop() {
super.onStop();
}