可能重複:
Android: How can I get the current foreground activity (from a service)?如何在屏幕上顯示當前活動?
在一個方法我必須知道哪些活動是在屏幕上。我如何獲得當前的活動?
可能重複:
Android: How can I get the current foreground activity (from a service)?如何在屏幕上顯示當前活動?
在一個方法我必須知道哪些活動是在屏幕上。我如何獲得當前的活動?
你能更精確一點嗎?該方法在哪裏?你想存檔什麼? – Tosa
getParent()。getActivity()將完成這項工作。這是我迄今爲止所能猜到的。 –