title: Custom Android notification sound
body: <p>I'm trying to implement a custom notification sound in my application.
  I have written the following code, but the application plays only default sound and not the custom sound i've added in raw folder. Upon receiving the notification, the logs doesn't even throw any error or exception as to why it isn't playing the custom sound. I tried searching online and tried following different approaches but to no avail.
  Please let me know where am i going wrong.</p>
  <p>Edit: Can someone post the code for it, i cant seem to find anything that works</p>
  <pre><code>Button button;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      button = findViewById(R.id.notify);
  
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.O) {
          NotificationChannel channel = new NotificationChannel(&quot;MyCuS Notification&quot;, &quot;My Notification&quot;, NotificationManager.IMPORTANCE_HIGH);
          NotificationManager manager = getSystemService(NotificationManager.class);
          AudioAttributes.Builder audioAttributes = new AudioAttributes.Builder()
                  .setUsage(AudioAttributes.USAGE_NOTIFICATION_RINGTONE);
          channel.setSound(Uri.parse(&quot;android.resources://&quot; + getPackageName() + &quot;/&quot; + R.raw.bg_reminder_alarm),audioAttributes.build());
          manager.createNotificationChannel(channel);
      }
  
      button.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              NotificationCompat.Builder builder = new NotificationCompat.Builder(MainActivity.this, &quot;MyCuS Notification&quot;);
              builder.setContentTitle(&quot;MyTitle&quot;);
              builder.setContentText(&quot;TESTING&quot;);
              builder.setSmallIcon(R.drawable.ic_launcher_background);
              builder.setAutoCancel(true);
              builder.setSound(Uri.parse(&quot;android.resources://&quot; + getPackageName() + &quot;/&quot; + R.raw.bg_reminder_alarm));
              NotificationManagerCompat managerCompat = NotificationManagerCompat.from(MainActivity.this);
              managerCompat.notify(1, builder.build());
          }
      });
  }
  </code></pre>
  <p>Edit 2: I tried deleting existing channel and sending notification to create new channel, when newly created the description of the channel changes after sending second notification, it is as if the channel is overridden or deleted and new default channel is created.</p>
  <p><a href="https://i.stack.imgur.com/mPNW7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mPNW7.png" alt="enter image description here" /></a></p>