📌  相关文章
📜  android 如何获取当前活动 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:09.844000             🧑  作者: Mango

代码示例1
ActivityManager am = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
ComponentName cn = am.getRunningTasks(1).get(0).topActivity;