codelab-activity_transitionapi icon indicating copy to clipboard operation
codelab-activity_transitionapi copied to clipboard

TransitionsReceiver Intent extras is always null

Open MaksimDmitriev opened this issue 3 years ago • 3 comments

I ran the complete debug variant of the app on Galaxy Z Flip 3 5G (Android 12) and Xiaomi Redmi K40 (Android 12). After walking for a 10 metres or so, TransitionsReceiver.onReceive was called. I assume it was walking activity detected. But intent.getExtras() was null. Hence, ActivityTransitionResult.hasResult(intent) returned false, and no information was printed.

I tried 31 and 32 for targetSdkVersion and compileSdkVersion

What is the issue?

MaksimDmitriev avatar Sep 21 '22 08:09 MaksimDmitriev

Can you show us your code

varun7952 avatar Oct 13 '22 23:10 varun7952

the bug was fixed by using the MUTABLE PendingIntent flag, not the IMMUTABLE one

MaksimDmitriev avatar Nov 09 '22 06:11 MaksimDmitriev

Thank you @MaksimDmitriev - saved me a lot of heartache.

hannahaponenko avatar Feb 16 '23 16:02 hannahaponenko