@Override public Object getSystemService(String name) { if (scope != null && scope.hasService(name)) { return scope.getService(name); } return super.getSystemService(name); }
@Override public Object getSystemService(String name) { // Note we dont create the scope here since this is usually called // before onCreate and we need to be able to fetch our scope name // on configuration changes return (mActivityScope != null && mActivityScope.hasService(name)) ? mActivityScope.getService(name) : super.getSystemService(name); }
@Override public Object getSystemService(String name) { if (rootScope == null) { rootScope = MortarScope.buildRootScope() .withService( ObjectGraphService.SERVICE_NAME, ObjectGraph.create(new ApplicationModule(this))) .build("Root"); } if (rootScope.hasService(name)) return rootScope.getService(name); return super.getSystemService(name); }