use of com.zhuinden.simplestackdemonestedstack.util.NestSupportServiceManager in project simple-stack by Zhuinden.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
NonConfigurationInstance nonConfigurationInstance = (NonConfigurationInstance) getLastCustomNonConfigurationInstance();
if (nonConfigurationInstance != null) {
serviceManager = nonConfigurationInstance.serviceManager;
serviceTree = serviceManager.getServiceTree();
} else {
serviceTree = new ServiceTree();
serviceTree.createRootNode(TAG);
serviceManager = new NestSupportServiceManager(serviceTree, TAG);
serviceManager.setRestoredStates(savedInstanceState != null ? savedInstanceState.getParcelable("SERVICE_BUNDLE") : new StateBundle());
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
backstack = Navigator.configure().setStateChanger(DefaultStateChanger.configure().setExternalStateChanger(this).create(this, root)).setStateClearStrategy(new PreserveTreeScopesStrategy(serviceTree)).install(this, root, HistoryBuilder.single(MainKey.create()));
}
Aggregations