内部で通知を処理するアラームマネージャを取得しようとするときに問題があります。これは、アプリのユーザーに特定のポイントに関する通知を与えることです。フラグメント内のAlarmManagerの通知
私のアラームは以下のコードでフラグメント内に設定されます。私のマニフェストで
Intent notificationIntent = new Intent(getContext(), DeviceBootReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
int hour = Integer.parseInt(vars.getShowRapport().getFinishTime().split(":")[0]);
int min = Integer.parseInt(vars.getShowRapport().getFinishTime().split(":")[1]);
vars.getShowRapport().getFinishDate().setHours(hour);
vars.getShowRapport().getFinishDate().setMinutes(min);
long futureInMillis = System.currentTimeMillis()+1000*60;
//long futureInMillis = vars.getShowRapport().getFinishDate().getTime();
AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);
alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, futureInMillis, pendingIntent);
getFragmentManager().beginTransaction().replace(R.id.makeRapportFragment,fragment).addToBackStack(null).commit();
私は私が持っているDeviceBootReceiverと呼ばれる私の受信機で
<receiver android:process=":remote" android:name=".DeviceBootReceiver">/receiver>
そして最後を持っています。私の問題がどこにある
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.ejservicebookincon)
.setContentTitle("Rapport finishing")
.setContentText("Rapport on item should be done.");
Intent notificationIntent = new Intent(context, ServiceRapportMain.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(contentIntent);
// Add as notification
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
manager.notify(0, builder.build());
は知ってはいけない、と私の受信機が作動しているように見えることはありませんので、まだのように、その部分の仕事かどうかを確認することはできません。誰かが私の問題がどこにあるのかを指摘できたら助けになります。私はAndroidスタジオで働いています。 "=プロセス::私は上記のコメントで書いたように
だったはずどこその後、1使用したことだったリモート「? –
これを例として使ってみましたが、それを削除しても何も起こりませんでしたが、私のエラーが見つかりました。私はAlarmManager.ELAPSED_REALTIME_WAKEUPを使用しました。ここで使用していたはずのものはAlarmManager.RTC_WAKEUPでした – silvertaildk