Question

I find that I override the onAttachedToWindow()

public void onAttachedToWindow()
{
    super.onAttachedToWindow();
    getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD);

}

I use an intent to open another activity which is full screen. Also, I click 'back' to back to my application. The status bar is disappear.

Anyone have an idea to make the status bar appear?

Was it helpful?

Solution

does there exist perfect solution to capture Home Key?

No, Applications (with the exception of replacement home screens) are not meant to be allowed to hijack the Home button. Any attempt to do so for an application is considered malicious behavior from the platforms perspective.

The TYPE_KEYGUARD that you are using was a bug in the system. This bug has been fixed in ICS and will no longer have the effect you desire moving forward.

OTHER TIPS

This is not allowed by the SDK due to the purposed of the home key. The home key is designed to allow the user to quit the application no matter what. It's to prevent malicious apps from hijacking the phone and rendering it unusable. If one were allowed to do so legally via the SDK an ap could be written that completely took over your phone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top