I have a alarm app which set alarm using Alarm Manager. Once the alarm goes off, it is received by the a receiver which starts the wakeful service which handle the alarm and allows user to stop or snooze the alarm.
below is the code snippet
public class AlarmReceiver extends WakefulBroadcastReceiver {
@Override
public void onReceive(Context context, final Intent intent) {
Alarm alarm = intent.getParcelableExtra(Constants.ARGS_ALARM);
}
}
I am getting the proper value in older version of Android but getting alarm as null on Nougat and Oreo. My App support Nougat of minSdkVersion 17.
What could be wrong in this code?