0
통지를 받으면 원시 폴더의 노래가 시작되도록 할 수 있습니까? "경고"노래를 시작하기 위해이 코드를 시도했지만 아무 일도 일어나지 않습니다.알림에 특정 노래 만들기
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.beatdanger,
"Your friend is in danger!!!", System.currentTimeMillis());
// Hide the notification after its selected
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notification.sound = Uri.parse("R.raw.alert");
Intent intent1 = new Intent("wael.ilahi.pfe.SMSRECEIVERESULT");
intent1.putExtra("coordination", str);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
intent1, 0);
notification.setLatestEventInfo(context, "Help your friend !!",
str, pendingIntent);
notificationManager.notify(0, notification);
일을 당신의 동의 속도에. 또한 LogCat에 어떤 종류의 오류 또는 예외 메시지가 있어야합니다. 질문에 추가하십시오. –
LogCat에 오류가 없습니다. –
내 대답을 확인 했습니까? –