私はアンドロイドが新しく、アラームマネージャとレシーバを使用して毎日通知するアプリケーションと通知も開発しています。デバイスがオフになっている場合しかし、今、私は5分ごとまでに通知を表示する必要があり、私は任意の通知(私はそれが永久に終了思う)と5分ごとに通知を受け取るにはどうすればいいですか?アンドロイドの通知バーからその通知を起動する必要がありますか?
を取得していない午前、二つの問題
に直面していますユーザーは通知バーからの通知を使用してアプリを起動しますが、わかりません。
public class AlarmReciever extends WakefulBroadcastReceiver { AlarmManager alarmManager; PendingIntent pendingIntent; int RequestCode =777; DBHelper helper; SQLiteDatabase database; SQLiteStatement statement; Cursor cursor; int datacount=0; public void onReceive(Context context, Intent intent) { String rec = intent.getDataString(); NotifyMessage(context); } public void NotifyMessage(Context context){ Intent intent = new Intent(context, NotificationTabs.class); intent.putExtra("Medicine", "Medicine"); PendingIntent pIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder builder = new NotificationCompat.Builder( context) .setSmallIcon(R.drawable.ic_launcher) .setTicker("Take medicine") .setContentTitle(context.getString(R.string.notificationtitle)) .setContentText("Take medicine") .addAction(R.drawable.ic_launcher, "Action Button", pIntent) .setContentIntent(pIntent) .setAutoCancel(true); NotificationManager notificationmanager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); notificationmanager.notify(0, builder.build()); }
私は、これらの問題を解決する方法についていくつかの助けを得るていただけますか?
フォーマットを少し修正しました。 これらの問題の解決策を見つけるために何を試しましたか?あなたが言及した問題はかなり一般的であり、いくつかの素早い研究によって解決策はかなり簡単に見つけることができます。 「Androidでアラームを繰り返す」を検索してみてください。 –