Hello,

Suppose I have one editText into which I typed something. And there is an AlarmManager . I created some event and closed the application. An event has arrived and a notification has appeared. So two questions are of interest:

1) By clicking on the notification, I switch to the specified Activity in the application. How to implement, so that I can open the Activity by clicking on the notification and see what I entered into editText?

2) Is it possible to create multiple Alarm' s? For example, created at 15 and 17 o'clock. Or just take turns? Initially, at 15, how will it pass, will it be possible at 17?

 Calendar calNow = Calendar.getInstance(); Calendar calSet = (Calendar) calNow.clone(); calSet.set(Calendar.HOUR_OF_DAY, timePicker.getCurrentHour()); calSet.set(Calendar.MINUTE, timePicker.getCurrentMinute()); calSet.set(Calendar.SECOND, 0); calSet.set(Calendar.MILLISECOND, 0); Intent intent = new Intent(getBaseContext(), AlarmReceiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(getBaseContext(), RQS_1, intent, 0); AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, targetCal.getTimeInMillis(), pendingIntent); 

    1 answer 1

    1) Store the edittext state in SharedPreferences or the database and restore at startup. What is the transition to go through Notifications.

    2) You can. The first will come - then the second, as I recall. Stackoverflow

    • 2) in my opinion, it is necessary to ask different ids there so that 2 alerts fall out (if I understand correctly what the question is about) - rasmisha