Вы должны использовать широковещательный приемник в своем приложении, чтобы получать широковещательные сообщения, когда пользователь нажимает на уведомление.
Пусть ваш широковещательный приемник - NotifBroadCastReceiver
public class NotifBroadCastReceiver extends BroadcastReceiver{
@override
void onReceive(Context context, Intent intent){
//you can extract info using intent.getStringExtra or any other method depending on your send data type. After that set alarm here.
}
}
Так что при создании ожидающего намерения вы можетеdo
Intent intent = new Intent(context, BroadcastReceiver.class);
//set all the info you needed to set alarm like time and other using putExtra.
PendingIntent alarmPendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
Теперь, когда пользователь нажимает на уведомление, вы получаете трансляцию в onReceive NotifBroadCastReceiver.
ПРИМЕЧАНИЕ Вы должны зарегистрировать свой широковещательный приемник в манифесте, как
<receiver
android:name="your broadcast receiver"
android:enabled="true"
android:exported="false" />