views:

83

answers:

2

I'm developing a Android desktop app, and I would like that when it first starts it (confirm with user and) set itself as default action for Home button.

Currently this option is given to the user by the Android system only when he first press the Home button after running my app.

Any idea how to do this?

--update

Actually, I want that the "back" button do not return to the default desktop, as my app will be de default desktop. Maybe the solution for this is the same of the one for the Home button..?

+4  A: 

You cannot do this.

Romain Guy
+1  A: 

Why not just let the system do it for you when the user presses the Home button for the first time. It's what the user is expecting. He/she doesn't expect it to change automatically and personally I would find that quite annoying if it did that since I like choosing my Home screen constantly.

As for the back button, simply add an onKeyDown/Up handler for the KeyEvent.KEYCODE_BACK event to return true (meaning handled by you, not the system). If you do that, it will not leave your app.

Moncader

related questions