warning: [deprecation] getParcelableExtra(String) in Intent has been deprecated

Reference:

https://developer.android.com/reference/android/content/Intent#getParcelableExtra(java.lang.String)

This method is deprecated from API level 33, so you can safely manage this situation with:

Uri uri;
if (Build.VERSION.SDK_INT >= 33)
    uri = intentResult
        .getParcelableExtra(
            RingtoneManager.EXTRA_RINGTONE_PICKED_URI, 
            Uri.class
        );
else
    uri = intentResult
        .getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);

Leave a Reply

Your email address will not be published. Required fields are marked *