0

I am trying to fetch as resource mp3 file in URI from preference and setting it into Notification to play mp3 Notification sound. But it isn't working giving error

parse (java.lang.string) in URI cannot be applied

Below is code : Setting

obj.setNotificationSound("android.resource://com.packagename.sampleapp/raw/pushsound");

Getting

String setnotificationsound = prefs.getNotificationSound(context);
Uri sound = Uri.parse(setnotificationsound);  //Received String as "R.raw.pushsound" 
            //but getting error (parse (java.lang.string) in URI cannot be applied)
b.setSound(sound);
user1223035
  • 241
  • 2
  • 21

0 Answers0