File tree Expand file tree Collapse file tree
android/src/main/java/com/levelasquez/androidopensettings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,4 +121,7 @@ AndroidOpenSettings.deviceInfoSettings()
121121
122122// Open application notification settings menu
123123AndroidOpenSettings.appNotificationSettings()
124+
125+ // Open sound settings menu
126+ AndroidOpenSettings.soundSettings()
124127```
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public void generalSettings() {
3232 reactContext .startActivity (intent );
3333 }
3434 }
35-
35+
3636 @ ReactMethod
3737 public void homeSettings () {
3838 Intent intent = new Intent (Settings .ACTION_HOME_SETTINGS );
@@ -231,4 +231,14 @@ public void appNotificationSettings() {
231231 reactContext .startActivity (intent );
232232 }
233233 }
234+
235+ @ ReactMethod
236+ public void soundSettings () {
237+ Intent intent = new Intent (Settings .ACTION_SOUND_SETTINGS );
238+ intent .addFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
239+ intent .addFlags (Intent .FLAG_ACTIVITY_NO_HISTORY );
240+ if (intent .resolveActivity (reactContext .getPackageManager ()) != null ) {
241+ reactContext .startActivity (intent );
242+ }
243+ }
234244}
Original file line number Diff line number Diff line change @@ -19,4 +19,5 @@ declare module "react-native-android-open-settings" {
1919 const applicationSettings : ( ) => void ;
2020 const deviceInfoSettings : ( ) => void ;
2121 const appNotificationSettings : ( ) => void ;
22+ const soundSettings : ( ) => void ;
2223}
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ const deviceInfoSettings = () => RNAndroidOpenSettings.deviceInfoSettings()
4242
4343const appNotificationSettings = ( ) => RNAndroidOpenSettings . appNotificationSettings ( )
4444
45+ const soundSettings = ( ) => RNAndroidOpenSettings . soundSettings ( )
46+
4547module . exports = {
4648 generalSettings,
4749 homeSettings,
@@ -63,4 +65,5 @@ module.exports = {
6365 applicationSettings,
6466 deviceInfoSettings,
6567 appNotificationSettings,
68+ soundSettings
6669}
You can’t perform that action at this time.
0 commit comments