0

i want to control home button in android for my application only...actually i have created one image of full screen in my application which is called after some task is done..So,when user got this image screen user cant go anywhere and here only i want to control HOME Button..So please give some idea or sample to achieve this..

Thanks in Advance----

Smith
  • 413
  • 3
  • 9
  • 24

1 Answers1

0

Yes, you can receive HOME intents. However, the user will have the choice between your "home activity" and the home activity that is bundled with the machine. The user will have to change their home button settings to always use your activity instead of the bundled one, and at that point they won't have any way to get to their real home.

However, none of this has anything to do with the screen you are currently on. This is likely impossible.

In any case, you can receive home key intents with this in your activity element in your manifest:

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Matthew
  • 44,826
  • 10
  • 98
  • 87
  • 2
    This is very helpful. However, I feel he is more interested in blocking users from going out of his activity, which I feel isn't possible. – Aman Alam Mar 24 '11 at 05:28
  • @sheikh so is there any way to lock our screen.actually i put button on image to go to next activity.....as i achieved to control back button n all..only home button is remained so give me some idea... – Smith Mar 24 '11 at 05:58
  • I have read a lot about it, and came across one statement by CommonsGuy (Mark Murphy) that Android isn't structured in a way that developers can change the behavior of the home button. :( – Aman Alam Mar 24 '11 at 06:18