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