Best way I know is to track state within your activities.

Looking at the state diagram on:

http://developer.android.com/reference/android/app/Activity.html

if onResume has been called and onPause has not then your activity
should be in the foreground.  It might not have focus though, if a
dialog box has it.



On Dec 14, 11:57 pm, rkewlani <rohit.kewl...@gmail.com> wrote:
> Acutally I was trying to automate some stuff on my android emulator. I
> start an activity through adb shell using "am" command, but when the
> activity starts do I have a way out to know that my activity is the
> one which is at the top & has the focus.
>
> I googled about it a lot but couldn't find the right way to do this.
>
> Any help would be greatly appreciated.
>
> Thanks.

-- 
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