package com.android.action.activity; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.Settings; import android.util.Log; class NS{ public static void GotoNS(Context context){ Intent intent = new Intent(); if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O) { intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS); intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName()); } else if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP&& Build.VERSION.SDK_INT=9) { intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); intent.setData(Uri.fromParts("package",context.getPackageName(),null)); } else if(Build.VERSION.SDK_INT<=8){ intent.setAction(Intent.ACTION_VIEW); intent.setClassName("com.android.settings", "com.android.setting.InstalledAppDetails"); intent.putExtra("com.android.settings.ApplicationPkgName", context.getPackageName()); } } context.startActivity(intent); } }