android app通知栏权限状态判断及跳转状态栏设置页面
import android.app.NotificationManager; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.Settings; import android.support.v4.app.NotificationManagerCompat; /** * Created by chenxiangxiang on 2019/1/16. */ public class Utils { public static boolean isPermissionOpen(Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { return NotificationManagerCompat.from(context).getImportance() != NotificationManager.IMPORTANCE_NONE; } return NotificationManagerCompat.from(context).areNotificationsEnabled