All IMA sample apps have single activity, but “taskAffinity” can affect only while navigate between multiple activities.
So cannot reproducible same issue with IMA 3.32.0
> Can you confirm whether the same behavior has been reported in IMA SDK version 3.31.0?
3.31 does not have issue.
> How the “taskAffinity” being set to null is impacting activity embedding?
So after upgrade IMA 3.32, we can see following log when DetailActivityStarter activity is started.
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: onTaskFragmentError
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: java.lang.SecurityException: Cannot embed ActivityRecord{15c7d87 u0 com.example.activity_embedding/.DetailActivityStarter} that launched on another task,mLaunchMode=LAUNCH_SINGLE_TASK,mLaunchFlag=10000000
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityStarter.sendCanNotEmbedActivityError(ActivityStarter.java:2783)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityStarter.addOrReparentStartingActivity(ActivityStarter.java:2728)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityStarter.setNewTask(ActivityStarter.java:2698)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityStarter.startActivityInner(ActivityStarter.java:1627)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityStarter.startActivityUnchecked(ActivityStarter.java:1398)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1227)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:703)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1292)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1233)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityTaskManagerService.startActivity(ActivityTaskManagerService.java:1208)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at android.app.IActivityTaskManager$Stub.onTransact(IActivityTaskManager.java:896)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at com.android.server.wm.ActivityTaskManagerService.onTransact(ActivityTaskManagerService.java:5333)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at android.os.Binder.execTransactInternal(Binder.java:1280)
03-27 16:04:02.002 1403 1432 W TaskFragmentOrganizerController: at android.os.Binder.execTransact(Binder.java:1244)