How to get current on screen activity? [duplicate]
Possible Duplicate:
Android: How can I get the current foreground activity (from a service)?
In a method I have to know which activity is on the screen. How do I get the current activity?
Sometimes Fragments need to know which Activity they belong to. For this, use Fragment.getActivity(). This works since API 11.Refer this
How do I get the current activity
You don't. There may not be a "current activity".
精彩评论