StringappName = getCurrentProcessName(sAppContext);
if (!TextUtils.equals(appName,sAppContext.getPackageName())) {
return;
}
StringgetCurrentProcessName(Context context) {
int pid = android.os.Process.myPid();
ActivityManager mActivityManager =(ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningAppProcessInfoappProcess : mActivityManager.getRunningAppProcesses()) {
if (appProcess.pid == pid) {
return appProcess.processName;
}
}
return "";
}