How to check if the home button was released or even the home activity cames out ?

asteroidg

New Member
Joined
Jan 8, 2011
Messages
8
Reaction score
0
How to check if the home button was released or even the home activity came out ?

Hi to every one.

How can I check inside the OnRestart method, if the home button was released ?

or

When the home button is released then the following intent is called { act=android.intent.action.MAIN ...}. How to check inside the method onRestart that the above Intent was called ?

Thank you in advance.
 
Last edited:
OP
A

asteroidg

New Member
Joined
Jan 8, 2011
Messages
8
Reaction score
0
I tried the following code:
ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);

List<ActivityManager.RunningAppProcessInfo> rs = am.getRunningAppProcesses();

for (int i=0; i<rs.size(); i++)
{
ActivityManager.RunningAppProcessInfo rsi = rs.get(i);
Log.i("ProcessLog", "Process PID=" + rsi.pid+"-"+rsi.processName);

}

The PID is the one that I need but the process always show me System, if it was a way to get from PID the following :
ActivityManager(81): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10200000 cmp=com.android.launcher/.Launcher }
then that could solve my request about to know when Home activity came out ...
 
Top