title: I want to set Push Notification Sound from Asset Folder ,Android
body: <p>I have an .mp3 file in <strong>asset</strong> folder named "error.mp3" . i want set that sound along with the push notification , how can i do that , i have tried this code to do that</p>
  
  <pre><code> Uri sound = Uri.parse("file:///android_asset/error.mp3");
   mBuilder.setSound(sound);
  </code></pre>
  
  <p>but its not working, when i use the default notification sound , it's working. i need some  help...</p>
  
  <p>This is my  <em>BroadcastReceiver</em> class</p>
  
  <pre><code>public class Notificationmassage extends BroadcastReceiver {
  
  
  @Override
  public void onReceive(Context context, Intent intent) {
  
  
      showNotification(context);
  
  }
  
  private void showNotification(Context context) {
      Log.i("notification", "visible");
  
  
  
      PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
              new Intent(context, MainActivity.class), 0);
  
      NotificationCompat.Builder mBuilder =
              (NotificationCompat.Builder) new NotificationCompat.Builder(context)
                      .setSmallIcon(R.drawable.ic)
                      .setContentTitle("Radio Planet")
                      .setContentText("Explore music");
      mBuilder.setContentIntent(contentIntent);
  
  
      mBuilder.setVibrate(new long[] { 500, 500});
  
  
      //Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
      //mBuilder.setSound(alarmSound);
  
  
  
     Uri sound = Uri.parse("file:///android_asset/error.mp3");
     mBuilder.setSound(sound);
  
      mBuilder.setAutoCancel(true);
      NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
      mNotificationManager.notify(2, mBuilder.build());
  
  
  }
  }
  </code></pre>