こんにちは私はアンドロイドが新しく、最初の1つは複数のアポイントメントリマインダーを設定し、2つ目は複数の月々の(請求書)リマインダを設定することです。毎日(薬)のリマインダーはすべて同じプロジェクトにあります。android multiple notification
LogCatに表示される3つのアラームを時間通りに設定すると問題はありますが、バー通知に薬の通知が表示され、その後に請求通知が発生するこの請求書通知は、スライドダウン通知の既存の薬通知を置き換え、逆も同様である。予定リマインダ通知が正常に機能しています。
スライドダウン通知の3つのカテゴリのすべてについて、既存のものを別のものに置き換えずに通知する必要があります。
私はこの問題が通知のコードにあると思いますが、私のコードで何が問題であるか把握できませんでした。
私はそれぞれのカテゴリー別にリマインダーサービスを別にしています。誰かがそれを見て、問題が何であるか教えてくれますか?
これは、薬のリマインダーサービス
public class Medicines_ReminderService extends WakeReminderIntentService {
public Medicines_ReminderService() {
super("ReminderService");
}
@Override
void doReminderWork(Intent intent) {
Log.d("MedicinesReminderService", "Doing work.");
Long rowId = intent.getExtras().getLong(RemindersDbAdapter.KEY_ROWID_MEDS);
NotificationManager mgr = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Intent notificationIntent = new Intent(this, MedicinesEdit.class);
notificationIntent.putExtra(RemindersDbAdapter.KEY_ROWID_MEDS, rowId);
int N_Med_requestCode = rowId.intValue();
PendingIntent pi = PendingIntent.getActivity(this, N_Med_requestCode, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
Notification note=new Notification(android.R.drawable.stat_sys_warning, getString(R.string.notify_new_reminder_message), System.currentTimeMillis());
note.setLatestEventInfo(this, getString(R.string.notify_new_medicine_reminder_title), getString(R.string.notify_new_reminder_message), pi);
note.defaults |= Notification.DEFAULT_SOUND;
note.flags |= Notification.FLAG_AUTO_CANCEL;
int id = (int)((long)rowId);
mgr.notify(id, note);
}
}
であり、これは事前に
public class Bills_ReminderService extends WakeReminderIntentService {
public Bills_ReminderService() {
super("ReminderService");
}
@Override
void doReminderWork(Intent intent) {
Log.d("BillsReminderService", "Doing work.");
Long rowId = intent.getExtras().getLong(RemindersDbAdapter.KEY_ROWID_BILLS);
NotificationManager mgr = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Intent notificationIntent = new Intent(this, BillsEdit.class);
notificationIntent.putExtra(RemindersDbAdapter.KEY_ROWID_BILLS, rowId);
int N_Bill_requestCode = rowId.intValue();
PendingIntent pi = PendingIntent.getActivity(this, N_Bill_requestCode, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
Notification note=new Notification(android.R.drawable.stat_sys_warning, getString(R.string.notify_new_reminder_message), System.currentTimeMillis());
note.setLatestEventInfo(this, getString(R.string.notify_new_bill_reminder_title), getString(R.string.notify_new_reminder_message), pi);
note.defaults |= Notification.DEFAULT_SOUND;
note.flags |= Notification.FLAG_AUTO_CANCEL;
int id = (int)((long)rowId);
mgr.notify(id, note);
}
}
おかげ
よろしく、あなたが使用している zoza