SoFunction
Updated on 2025-03-11

Example of android jump to the app notification settings interface

4.4 The following does not mention the action of jumping from the app to the application notification settings page. You can consider jumping to the application details page. The following is the code to jump directly to the application notification settings:

 if (.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
          Intent intent = new Intent();
          (".APP_NOTIFICATION_SETTINGS");
          ("app_package", getActivity().getPackageName());
          ("app_uid", getActivity().getApplicationInfo().uid);
          startActivity(intent);
        } else if (.SDK_INT == Build.VERSION_CODES.KITKAT) {
          Intent intent = new Intent();
          (Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
          (Intent.CATEGORY_DEFAULT);
          (("package:" + getActivity().getPackageName()));
          startActivity(intent);
        }

The code to jump to the application details page is as follows:

 Intent localIntent = new Intent();
        (Intent.FLAG_ACTIVITY_NEW_TASK);
        if (.SDK_INT >= 9) {
          (".APPLICATION_DETAILS_SETTINGS");
          (("package", getActivity().getPackageName(), null));
        } else if (.SDK_INT <= 8) {
          (Intent.ACTION_VIEW);
          ("", "");
          ("", getActivity().getPackageName());
        }
        startActivity(localIntent);

To detect whether the notification is enabled for the app, it is also valid for systems above 4.4:

NotificationManagerCompat manager = (().getContext());
boolean isOpened = ();

4.4 There will be no error when calling this method below, but all return true, and the default is enabled.

The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.