Android : Unable to User Selected Sound to Push Notification

on Friday, September 19, 2014


Hi I'm working on Push Notification in my app. In that I'm able to get Notification successfully. I'm trying to set user selected sound to Push notification. For that I'm storing user selected sound file path in preferences



NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
mBuilder.setSmallIcon(R.drawable.ic_launcher);
mBuilder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.notif_icon));
mBuilder.setContentTitle(context.getString(R.string.app_name));
mBuilder.setTicker("Message from " +context.getString(R.string.app_name));
mBuilder.setWhen(System.currentTimeMillis());
mBuilder.setAutoCancel(true);
Uri uri = Uri.parse(CommonUtilities.sp.getString("PUSHNOTIFICATIONTONE", "Null"));
Log.d("Path: ", uri.toString());
mBuilder.setSound(uri);


I'm getting exact path in Log as I selected before



09-19 16:14:45.511: D/Path:(17832): content://com.estrongs.files/mnt/sdcard/Ringtones/bbm_tone.wav


Can Any one tell me, where I'm getting wrong??


0 comments:

Post a Comment