Created
June 25, 2017 06:41
-
-
Save bangarharshit/60d4e7a6c2cac05b37963cb81aebc668 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
private Router router; | |
@Override protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
ViewGroup container = (ViewGroup)findViewById(R.id.controller_container); | |
router = Conductor.attachRouter(this, container, savedInstanceState); | |
if (!router.hasRootController()) { | |
router.setRoot(RouterTransaction.with(new HomeController())); | |
} | |
} | |
@Override | |
public void onBackPressed() { | |
if (!router.handleBack()) { | |
super.onBackPressed(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment