Last active
February 1, 2020 09:54
-
-
Save diousk/fa267a19dd8f700ec888610275b88881 to your computer and use it in GitHub Desktop.
This file contains 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 abstract class FragmentInjectActivity extends AppCompatActivity | |
implements HasAndroidInjector { | |
@Inject DispatchingAndroidInjector<Object> androidInjector; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
AndroidInjection.inject(this); | |
beforeOnCreate(); // <-- expose here for child to do things before onCreate | |
super.onCreate(savedInstanceState); | |
} | |
protected abstract void beforeOnCreate(); | |
@Override | |
public AndroidInjector<Object> androidInjector() { | |
return androidInjector; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment