알림이 지워지는시기를 감지하려고합니다. 내 질문에 직접 언급 한이 내용은 answer입니다.Notification.deleteIntent 사용 방법
// usual Notification initialization here
notification.deleteIntent = PendingIntent.getService(context, 0, new Intent(context, CleanUpIntent.class), 0);
notificationManager.notify(123, notification)
이것은 CleanUpIntent 클래스입니다 : 이것은 내가 조치 구현하고있어 어떻게 난 그저 내가 평소하지만 같은 알림을 시작, 이후
class CleanUpIntent extends IntentService {
public CleanUpIntent() {
super("CleanUpIntent");
}
@Override
protected void onHandleIntent(Intent arg0) {
// clean up code
}
}
을 나는 (그것을 테스트에 갈 때 "모든 알림 지우기"를 누르면) 아무 일도 일어나지 않습니다. IntentService가 시작될 때 LogCat에 인쇄 할 코드 줄을 삽입했지만 아무 것도 실행하지 않았습니다. 이것이 내가 Notification.deleteIntent를 사용하는 방법입니까?
IntentFilter 플래그가 알림을 지울 때 잡기 위해 무엇인지 알고 있습니까? – Brian
'IntentFilter' 플래그가 아니며,'BroadcastReceiver'입니다 : http://code.google.com/p/islamictools/source/browse/trunk/IslamicTools/src/com/alpha/commun/MsgNotification을보십시오. .java? spec = svn11 & r = 11 당신이 어떻게 할 것인지 예를 들어 보자. – Femi
나는 BroadcastReceivers에 너무 친숙하지 않지만 내 질문은 수신기를 등록하는 방법에 관한 것이었다. Content.registerReceiver를 호출하거나 수동으로 AndroidManifest에 넣을 지 여부에 상관없이 IntentFilter를 제공 할 필요가 없습니까? – Brian