Last active
June 11, 2019 06:37
-
-
Save alaershov/7f23902d403d685f94df86748f05650b to your computer and use it in GitHub Desktop.
Toothpick: sample Activity
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 final class UserActivity extends AppCompatActivity { | |
@Inject | |
UserRepository userRepository; | |
@Override | |
protected void onCreate(@Nullable Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
Scope appScope = Toothpick.openScope("APP"); | |
Toothpick.inject(this, appScope); | |
showUser(userRepository.getUser()); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment