摘要:
/** *判断当前应用程序处于前台还是后台 * * @param context * @return */public static boolean isApplicationBroughtToBackground(final Context context) {ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);List tasks = am.getRunningTasks(1);if (!tasks.isEmpty()) {ComponentName topAct 阅读全文