简体   繁体   中英

App ignoring Home button press

I downloaded a drawing app for my kid that protects against the child accidentally exiting out of the app by hitting the Home button.

In the past I've done similar things by registering my app as a Launcher and the effect is that the child hits the button and the app onPause saves state and relaunches in exactly the same state (the parent has a hidden control to exit).

However, *this app doesn't do this because it's clearly not quitting/restarting. It's just totally ignoring the Home button press.

I thought this was not possible, and am really curious if anyone knows how they are accomplishing this.

It's actually not ignoring the home button. What's actually happening is the launcher is catching it and then sending a new intent to launch the app again. If you're trying to replicate this then you'll need to fire off an intent which is meant to bring the app back to the top rather than make a new instance. The other minor change is you will also want to remove any sort of transition animation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM