获取运行的activity的名字

xiaoxiao2021-02-28  27

/** * @param context * @return */ public static String getRunningActivityName(Context context) { ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); String runningActivity = activityManager.getRunningTasks(1).get(0).topActivity.getClassName(); return runningActivity; }
转载请注明原文地址: https://www.6miu.com/read-2800126.html

最新回复(0)