DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Results 1 to 3 of 3

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

  1. Junior Droid
    asteroidg's Avatar
    Member #
    158279
    Join Date
    Jan 2011
    Posts
    8
    Phone
    Enter Current Phone Model Here
    #1

    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 by asteroidg; 01-13-2011 at 02:44 PM. Reason: -
  2.  
     
     
     
  3. Junior Droid
    asteroidg's Avatar
    Member #
    158279
    Join Date
    Jan 2011
    Posts
    8
    Phone
    Enter Current Phone Model Here
    #2
    I tried the following code:
    ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SE RVICE);

    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 ...
  4. Junior Droid
    asteroidg's Avatar
    Member #
    158279
    Join Date
    Jan 2011
    Posts
    8
    Phone
    Enter Current Phone Model Here
    #3
    Any ideas ?

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Home button help!
    By Ninelives29 in forum Android Tech Support
    Replies: 2
    Last Post: 12-24-2010, 10:48 AM
  2. ver 4.0.7 home button not working
    By eliju in forum LithiumMod
    Replies: 2
    Last Post: 09-17-2010, 09:40 PM
  3. activity home force closing
    By karnage in forum Rescue Squad Help
    Replies: 1
    Last Post: 06-14-2010, 09:04 PM
  4. home button
    By crewcheifgtaa in forum Motorola Droid
    Replies: 8
    Last Post: 03-28-2010, 07:48 AM
  5. sluggish home button
    By eskanday in forum Android General Discussions
    Replies: 0
    Last Post: 11-30-2009, 10:31 AM

Search tags for this page

activitymanager action main
,
activitymanager home key
,
android activity home button
,

android detect home button

,
android detect home button press
,
android detect home key
,
android detect home press
,
android intent home button
,
detect home button android
,
iphone check if an object is released
Click on a term to search our site for related topics.

Tags for this Thread

Find us on Google+