'Android - PendingIntent.getActivities() API not working as intended in Xiomi devices
I am working with an Android API in my app and it is not working properly on Redmi phones. On all other phones it is working fine. I have tested it on Google pixel, Samsung and OnePlus phones.
It is probably the issue with the custom Android OS on Redmi phones. I have tested it on Redmi devices with Android OS 7, 9 and 10.
Below are the details:
API - PendingIntent.getActivities ( context, requestCode, arrayOf(intent1, intent2), flags )
Here intent1 launches Activity1 and intent2 launches Activity2.
Expected behaviour - When I attach a pending intent created using the above API to a notification using NotificationBuilder.setContentIntent(pendingIntent) and display the notification. If I click the notification when the app is in killed or background state, On notification click, first Activity2 should open and on closing Activity2, Activity1 should open.
Observed behaviour - If I click on notification when app is in killed or background state, only Activity2 is opened and Activity1 is not opened. This is the issue. If app is in foreground state, API works fine.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
