Last active
November 27, 2017 01:14
-
-
Save larkintuckerllc/0229cfac87c5e3620267c36fca3f1373 to your computer and use it in GitHub Desktop.
How-to Dagger 2 with Android: Part 1 - 11
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 class MainActivity extends AppCompatActivity { | |
@Inject MyExample mMyExample; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
TextView dateTextView = findViewById(R.id.tvDate); | |
((MyApplication) getApplication()) | |
.getMyComponent() | |
.inject(MainActivity.this); | |
dateTextView.setText((new Date(mMyExample.getDate())).toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment