onCreate(savedInstanceState: Bundle?) { var storeFragment = supportFragmentManager .findFragmentByTag(UserComponentFragment.TAG) as? UserComponentFragment if (storeFragment == null) { storeFragment = UserComponentFragment() supportFragmentManager .beginTransaction() .add(storeFragment, UserComponentFragment.TAG) .commit() } if (storeFragment.component == null) { //init component } storeFragment.component.inject(this) } }