Search code examples
androidconductorandroid-mvp

How to remove a Controller from the router backstack in Conductor?


I'm using Conductor and Mosby to implement MVP-MVC architecture in an android app.
What I need to do is remove a Controller from the backstack of a router so that upon onBackPressed that controller is no longer brought back up to the front.


Solution

  • If you want to remove current controller, do like @sockeqwe said: call router.popCurrentController().

    If you want to remove some specific controller from the backstack, you could try calling router.popController(your_controller).