判断App是否处于前台
方法一: //当前应用是否处于前台 private boolean isForeground(Context context) { if (context != null) { ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);...