开发者

How to get current on screen activity? [duplicate]

开发者 https://www.devze.com 2023-03-27 01:35 出处:网络
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)?
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

精彩评论

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