play notification sound from uri or from raw folder : > first of all i would say there are many ans related to this but i didn't get they match with my requirement 
> 
> i m letting user to choose sound from their phone storage and save path to db and when notification comes about to show and set sound i fetch sound from that notification id exist play chose sound or play default sound.... but this is not working at All...it playing no sound not chose nor default..

**google research says**

> many answers i found that were suggesting to play sound from raw folder but i don't get ans  by which i save user selected sound to raw folder(of course programmatically) so i can play sound from raw folder..


**code**

     private void showNotification(Context context, Things things) {
    
        try {
            NotificationManager mNotifyMgr =
                    (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);

            NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
                    .setSmallIcon(R.drawable.icon)
                    //example for large icon
                    .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.icon))
                    .setContentTitle(things.getTitle())
                    .setContentText(things.getThing()).setSubText(things.getNotification())
                    .setOngoing(false)
                    .setPriority(NotificationCompat.PRIORITY_DEFAULT)
                    .setAutoCancel(true);
            Intent i = new Intent(context, HomeActivity.class);
            PendingIntent pendingIntent =
                    PendingIntent.getActivity(
                            context,
                            0,
                            i,
                            PendingIntent.FLAG_ONE_SHOT
                    );
            // example for blinking LED
            mBuilder.setLights(0xFFb71c1c, 1000, 2000);
            if (things.getRingtone() == null || things.getRingtone().equals("")) {
                mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));

            } else {
               Ringtone r = RingtoneManager.getRingtone(context, Uri.parse(things.getRingtone()));
                r.play();
                Toast.makeText(context, things.getRingtone(), Toast.LENGTH_SHORT).show();
            }
            //mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
            mBuilder.setContentIntent(pendingIntent);
            mNotifyMgr.notify(12345, mBuilder.build());
        } catch (Exception e) {
            Log.d(getClass().getName(), "catch  " + e.toString());
        }
    }