Android Launcher app - Pressing Home Button in other Activity

709 views Asked by At

I've written a custom Launcher that has three activities. I looked up the sample home app and configured the intent filters accordingly for the main activity - that is the first activity which is launched at start - android.intent.action.MAIN. Let's call it Activity A. In this Activity A I'm able to control what the HOME button does by dispatching the KEYCODE_HOME KeyEvents - which is all and well. However once I move to another Activity in the same Application, let's call it Activity B I'm no longer able to override the Home Button.

Is there any way to capture the KEYCODE_HOME KeyEvents in other Activities within the same launcher app? Are there any other intent-filters for the other two Activities that I should consider?

I've used the home sample app as a reference and I've applied the same actions and intent-filters. I also use the same public boolean dispatchKeyEvent(KeyEvent event) method. I know that you're not allowed to capture the KEYCODE_HOME KeyEvents unless your App is a HOME app.

0

There are 0 answers