Question: Is that possible to get notification when Home button is pressed or Home Screen is launched?

In [Android Overriding home key](https://stackoverflow.com/questions/5039500/android-overriding-home-key) thread i read that "it will be notified when the home screen is about to be launched". So is that possible, if yes how?

Thank you

Answer: 
> 
> Is that possible to get notification when Home button is pressed or Home Screen is launched?
> 
> 
> 

Only by being a home screen.
You can `Detect Home Screen is running or not`.  

You can see [this page](http://andytsui.wordpress.com/2012/08/02/detect-home-screen-is-running-or-not-android/) for more details,Or you can see [this answer](https://stackoverflow.com/a/6562223/1043882).It propose use `isScreenOn ()` from `PowerManager`(Returns whether the screen is currently on. The screen could be bright or dim):

```
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
boolean isScreenOn = pm.isScreenOn();

```