如何为 NotificationCompat.Builder 创建的通知添加声音?我在 res 中创建了一个 raw 文件夹并在那里添加了声音。那么我现在如何将它添加到通知中呢?这是我的通知代码
int NOTIFY_ID=100;
Intent notificationIntent = new Intent(this, Notification.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setContentIntent(pendingIntent)
.setSmallIcon(R.drawable.notification)
.setContentTitle("Warning")
.setContentText("Help!")
NotificationManager mgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mgr.notify(NOTIFY_ID, mBuilder.build());