NotificationCompat.Builder tarafından oluşturulan bir bildirime nasıl ses eklersiniz? Res'de bir ham klasör oluşturdum ve sesi oraya ekledim. Peki şimdi bunu bildirime nasıl eklerim? setSound(Uri soundUri)
- Bu benim Bildirim koduBildirime nasıl ses eklenir?
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());
[NotificationCompat.Builder'da bir [setSound] (http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setSound (android.net.Uri)) yöntemi var. ] (http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html). Aradığın şey bu mu? –