I have a solution for home screen detection, but its slow and
horrible.
I run this bit of code every 1 seconds.

ActivityManager actvityManager = (ActivityManager)
this.getSystemService( ACTIVITY_SERVICE );
                List<RunningAppProcessInfo>  procInfos =
actvityManager.getRunningAppProcesses();

                for(int i = 0; i < procInfos.size(); i++)
                {

                        if(procInfos.get(i).processName.compareTo
( "android.process.acore") == 0
                                        && procInfos.get(i).importance ==
RunningAppProcessInfo.IMPORTANCE_FOREGROUND)
                        {

                                // Home Screen Detected! Do something...
                        }

                }

I hate continually polling a piece of code but I don't think there is
a broadcast intent that will help me out.

Do anybody know of a better way of doing this?

On Aug 28, 2:41 pm, Dianne Hackborn <hack...@android.com> wrote:
> They are described 
> here:http://developer.android.com/guide/topics/fundamentals.html
>
> On Fri, Aug 28, 2009 at 10:53 AM, GodsMoon <godsm...@gmail.com> wrote:
>
> > What's the difference between a Task and a Process for
> > ActivityManager?
>
> > On Aug 28, 1:46 pm, Hong <lordh...@gmail.com> wrote:
> > > ActivityManager : getRunningTasks(int)
>
> > > On Thu, Aug 27, 2009 at 6:24 PM, GodsMoon <godsm...@gmail.com> wrote:
>
> > > > That might be enough info for my app.
> > > > Which api are you looking at?
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to