On Mon, Jul 16, 2012 at 2:30 AM, HK <[email protected]> wrote: > Is there a way to find current activity(activity which is on focus to the > user) ?
For your own activities, keep track of it yourself. If you are referring to third-party activities, Android is slowly closing off access to this sort of information, as malware uses it. > One way is: > > public List<ActivityManager.RunningTaskInfo> getRunningTasks (int maxNum) > > > but the Android documentation says not to use this in core logic. Correct. > Is there any other way where I can use 'finding out current activity' in > core logic ? Not for third-party activities. Android apps should neither know nor care what happens to be in the foreground, if it is not their own stuff. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Training in NYC: http://marakana.com/training/android/ -- 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

