Does anyone know if there are any changes regarding how Android 7.0 (Nougat) handles intentions compared to Android 6.0 (Lollipop)?
In short: my application works as intended on all versions from 4.1 (16) to 6.0 (23), but it crashes on android 7.0 (24)!
The application creates a pending intent with the intention of setting up a custom broadcast receiver with additional features. However, on Android 7, none of the additional features are present in the intent received by the broadcast receiver.
MainActivity.java
Intent intent = new Intent(context, PollServerReceiver.class);
PollServerReceiver.java
Bundle extras = intent.getExtras(); Log.d(TAG, "onReceive: TESTING1 = " + extras.getString("TESTING1"));
The stack trace obviously gives a NullPointerException as the reason for the failure. It would not be so strange if it crashed among all versions, but in this case its only the latest Android. Anyone have any ideas please?
Note. I tried to create pending intentions with different flags, including ( 0 , PendingIntent.FLAG_UPDATE_CURRENT , PendingIntent.FLAG_CANCEL_CURRENT ), still got the same result.
android android-intent android-7.0-nougat android-broadcastreceiver android-pendingintent
Konaras
source share