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 <[email protected]> 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 <[email protected]> wrote: > > They are described here: > http://developer.android.com/guide/topics/fundamentals.html > > > > On Fri, Aug 28, 2009 at 10:53 AM, GodsMoon <[email protected]> wrote: > > > > > What's the difference between a Task and a Process for > > > ActivityManager? > > > > > On Aug 28, 1:46 pm, Hong <[email protected]> wrote: > > > > ActivityManager : getRunningTasks(int) > > > > > > On Thu, Aug 27, 2009 at 6:24 PM, GodsMoon <[email protected]> > wrote: > > > > > > > That might be enough info for my app. > > > > > Which api are you looking at? > > > > -- > > Dianne Hackborn > > Android framework engineer > > [email protected] > > > > 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 [email protected] 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

