开发者

How to set my App as default Home?

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 aft开发者_开发知识库er running my app.

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

Any idea how to do this?


You cannot do this.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜