Is there any way I can launch an intent to get to Android\'s notification settings screen for my app (pictured below)? Or an easy way I can make a PreferenceScreen item that
Finally i tested almost all devices and works fine. The code given as follows
public void goToPushSettingPage(Context context) {
try {
Intent intent=new Intent();
if(Build.VERSION.SDK_INT>Build.VERSION_CODES.N_MR1){
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){
intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS);
intent.putExtra(ConstUtil.PUSH_SETTING_APP_PACKAGE,context.getPackageName());
intent.putExtra(ConstUtil.PUSH_SETTING_APP_UID,context.getApplicationInfo().uid);
}else{
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setData(Uri.parse(ConstUtil.PUSH_SETTING_URI_PACKAGE+context.getPackageName()));
}
startActivity(intent);
} catch (Exception e) {
// log goes here
}
}