In facebook chatheads, that are part of the facebook messenger app, I noticed the following behavior: As far as I can see, the chat head itself and the opened chat screen ar
I'm fairly sure facebook doesn't listen for home button presses, because their logic requires the chat heads to show up regardless of what app is visible, as long as it isn't facebook.
A simple and crude way to do this would be to maintain a static flag visible
in your Application singleton, and modify it from every Activity you have. In the onPause(), set it to false
, and in onResume() and onCreate() set it to true
.
Then simply check the state of this flag, and act accordingly. If its true, it means your app is visible.
You might want to add a small pause before you act on it to prevent your injected Views from flickering each time an Activity is changed.
You can add the category HOME to your manifest file.