Search code examples
androidandroid-preferencesandroidxandroid-settings

Androidx Preferences not incuding RingtonePreference


I'm doing the settings activity for my app via code since the xml editor wont find any preferences but PreferenceScreen. Via code everything is working but I can not find the RingtonePreferences from Androidx, the only one I find is the one from android.preference.RingtonePreference.

I have this implementation.

implementation "androidx.preference:preference:1.1.0-alpha02"

RingtonePreference has not been added yet? or there is another preference under another name I can use in order to let users choose a notification sound. Thanks!


Solution

  • RingtonePreference has not been added yet?

    Google has stated that their libraries will not support RingtonePreference.

    or there is another preference under another name I can use in order to let users choose a notification sound

    Use a ListPreference. Or use this workaround. Or create a custom Preference that integrates with the ringtone APIs.