Conductor: startActivityForResult alternative for Controllers?

Created on 2 May 2016  路  2Comments  路  Source: bluelinelabs/Conductor

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 :)

All 2 comments

@sockeqwe Thank you for the fast reply. This worked really well for me :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DJafari picture DJafari  路  4Comments

moezbhatti picture moezbhatti  路  7Comments

ghost picture ghost  路  5Comments

PaulWoitaschek picture PaulWoitaschek  路  5Comments

lenguyenthanh picture lenguyenthanh  路  5Comments