NotificationCompat.Builder에서 만든 알림에 사운드를 어떻게 추가합니까? res에 raw 폴더를 만들고 거기에 사운드를 추가했습니다. 이제 알림에 어떻게 추가합니까? setSound(Uri soundUri)
- 이건 내 알림 코드알림에 소리를 추가하는 방법은 무엇입니까?
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]에 [setSound] (http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setSound (android.net.Uri)) 메소드가 있습니다. ] (http://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html). 그게 당신이 찾고있는거야? –