@@ -0,0 +1,871 @@
+package baidu.com.commontools.utils;%0A%0Aimport android.app.ActivityManager;%0Aimport android.content.Context;%0Aimport android.os.Process;%0Aimport android.support.annotation.Nullable;%0A%0Aimport java.util.List;%0A%0Aimport static android.content.Context.ACTIVITY_SERVICE;%0A%0A/**%0A * Created by Wayne on 2017/3/26.%0A */%0A%0Apublic class ProcessUtils %7B%0A%0A    @Nullable%0A    public static String getProcessName(Context cxt) %7B%0A        int pid = Process.myPid();%0A        ActivityManager am = (ActivityManager) cxt.getSystemService(ACTIVITY_SERVICE);%0A        List%3CActivityManager.RunningAppProcessInfo%3E runningApps = am.getRunningAppProcesses();%0A        if (runningApps != null && !runningApps.isEmpty()) %7B%0A            for (ActivityManager.RunningAppProcessInfo info : runningApps) %7B%0A                if (info.pid == pid) return info.processName;%0A            %7D%0A        %7D%0A%0A        return null;%0A    %7D%0A%7D%0A

change : add ProcessUtils.java.