Pressing Home twice will always take a user back to the center panel of the Home Screen, so whatever application they're running, it's easy for a user to get back to somewhere they know. You shouldn't really be overriding this unless you're producing a full Home replacement.
Don't permanently override the Home button without the user confirming it.
We need to do follow three steps here...
1. Override onKeyDown and compare keycode with KeyEvent.KEYCODE_HOME
2. Override
onAttachedToWindow()
3. add category to the activity because
CATEGORY_HOME : This is the home activity, that is the first activity that is displayed
when the device boots.
<category android:name="android.intent.category.HOME"/>Solution: Source Code Here