Hi o/
For my app I decided to try to use just a single Activity, and have different "screens" (something like an Activity) using only controllers.
This works great. However, I'm not sure how to best simulate the startActivityForResult functionality using controllers alone.
Basically I want the previous controller on the "task stack" to get the results of the "top" controller.
Right now I'm using something like this to pass results from one controller to the another:
val c = router.getControllerWithTag(MainActivity.TAG_MAIN_CONTROLLER)
(c as ScreenMainController).routeFromOthersScreens = MainMvpView.Route.Steps
router.popCurrentController()
This has the disadvantage of adding hard dependencies between the controllers, and they need to know how to relate between them.
My question is if there is anything similar to onActivityResult but for controllers?
Thank you :)
You can set a target controller, which is similar to the communication between Activity and Fragments:
@sockeqwe Thank you for the fast reply. This worked really well for me :+1:
Most helpful comment
You can set a target controller, which is similar to the communication between Activity and Fragments:
https://github.com/bluelinelabs/Conductor/blob/develop/demo/src/main/java/com/bluelinelabs/conductor/demo/controllers/TargetDisplayController.java
https://github.com/bluelinelabs/Conductor/blob/develop/demo/src/main/java/com/bluelinelabs/conductor/demo/controllers/TargetTitleEntryController.java#L44