I'm writing an app that turns off the keyguard and I would like to
exitKeyguardSecurely when you user goes back to the home screen.
This works great when hitting the Home button, but the user can back
to the home screen without prompt by using the back button (I think
this is an API bug).
So I'm trying to determine if the Home screen is displayed so I can
force exitKeyguardSecurely.

I realize homescreen replacements will break this code but until the
API bug gets fixed I don't see a good way around this.

On Aug 29, 2:35 pm, Dianne Hackborn <hack...@android.com> wrote:
> No there is no API to do this.  What are you trying to accomplish?
>
> Note that your code will break in many many situations -- when a custom home
> screen is being used, on a device where the manufacturer is not using the
> base platform home app, in the future when we have more memory so don't need
> to run home in a shared process, etc.
>
>
>
> On Sat, Aug 29, 2009 at 9:59 AM, GodsMoon <godsm...@gmail.com> wrote:
>
> > 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.
>
> --
> 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