判断当前的Activity的是否处于栈顶
lockAppName 是需要判断APK的包名.private boolean getTopApp(Context mContext) { String lockAppName = "com.celltick.lockscreen.LockerActivity"; String topActivityName = ""; ActivityManager am = (Ac