开发者

How to get current on screen activity? [duplicate]

This question alrea开发者_JAVA技巧dy has answers here: Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜