I regularly check something in one app. I made a flow which saves current foreground package+activity, uses the "App start" block (with flag "Reorder to front") to start my app, checks something, then goes back to previously saved package+activity (using again "App start" block with flag "Reorder to front").
But after some time it stops going back to previously saved activity and my app stays in foreground. I see one error recurring:
08-12 11:17:15.271 F 9932530@213: android.os.RemoteException: Remote stack trace:
at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(qb/98275673 de8329695e1bc756b4a122601024faf5ecbd66fab28e30fccd3a75993b49c32b:644)
at com.android.server.wm.ActivityStarter.executeRequest(qb/98275673 de8329695e1bc756b4a122601024faf5ecbd66fab28e30fccd3a75993b49c32b:1382)
at com.android.server.wm.ActivityStarter.execute(qb/98275673 de8329695e1bc756b4a122601024faf5ecbd66fab28e30fccd3a75993b49c32b:1122)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(qb/98275673 de8329695e1bc756b4a122601024faf5ecbd66fab28e30fccd3a75993b49c32b:88)
at com.android.server.wm.ActivityTaskManagerService.startActivity(qb/98275673 de8329695e1bc756b4a122601024faf5ecbd66fab28e30fccd3a75993b49c32b:120)
How can I fix this?