You can launch your activity when you press button. For that you have to declare your activity's action as HOME.
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
But there are disadvantages of this:
- A chooser will appear when you press home button. This will let you decide which activity to launch. As default launcher app also has same action (HOME), it will ask you which activity to launch.
- You can make your activity a default activity when user presses on home button. You can do it when you get chooser dialog after pressing home button, just check that check box appeared on chooser dialog.
In 2nd case, you can make your activity a default activity when you press home button but then it will not launch default Home sceen which is very usefull when you want to launch other apps. So its always advisable not to handle Home button.
Also you cannot handle Home key same as other key events(like Back Key, Menu Key etc.)