@@ -0,0 +1,1134 @@
+%0Aimport android.app.ActivityManager;%0Aimport android.content.Context;%0Aimport android.os.Build;%0A%0Aimport java.util.List;%0A%0Apublic class AppUtlis%0A%7B%0A    private AppUtlis()%7B%7D%0A%0A    /**%0A     * %E8%8E%B7%E5%8F%96%E6%A0%88%E9%A1%B6Activity%E7%B1%BB%E5%90%8D,%E4%B8%80%E8%88%AC%E5%8F%AA%E8%83%BD%E8%8E%B7%E5%8F%96%E8%87%AA%E5%B7%B1%E5%BA%94%E7%94%A8%E7%9A%84%EF%BC%8C5.0%E4%B9%8B%E5%90%8E%E5%AF%B9%E8%BF%99%E4%B8%80%E6%9D%83%E9%99%90%E5%81%9A%E4%BA%86%E6%9E%81%E5%A4%A7%E7%9A%84%E9%99%90%E5%88%B6%0A     * %3Cp%3E%0A     *     %E9%9C%80%E8%A6%81%E6%B7%BB%E5%8A%A0%E6%9D%83%E9%99%90: android.permission.GET_TASKS%0A     * %3C/p%3E%0A     */%0A    public static String getTopActivityName(Context context)%0A    %7B%0A        String name = %22%22;%0A%0A        ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);%0A%0A        if(Build.VERSION.SDK_INT %3E= Build.VERSION_CODES.M)%0A        %7B%0A            List%3CActivityManager.AppTask%3E appTasks = manager.getAppTasks();%0A            if(appTasks != null && appTasks.size() %3E 0)%0A            %7B%0A                name = appTasks.get(0).getTaskInfo().topActivity.getClassName();%0A            %7D%0A        %7D%0A        else%0A        %7B%0A            List%3CActivityManager.RunningTaskInfo%3E taskInfos = manager.getRunningTasks(1);%0A            if(taskInfos != null && taskInfos.size() %3E 0)%0A            %7B%0A                name = taskInfos.get(0).topActivity.getClassName();%0A            %7D%0A        %7D%0A%0A        return name;%0A    %7D%0A%7D%0A

add addutils