Last active
August 25, 2017 07:28
-
-
Save satadii11/12a44fa4c6f77091aefb2caf92bbbf8a 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
class Presenter implements IPresenter{ | |
@Inject | |
IView view; | |
@Inject | |
Presenter(); | |
} | |
@Module | |
class ViewModule{ | |
private IView mView; | |
public ViewModule(IView view){ | |
mView = view; | |
} | |
@Provides | |
IView provideView(){ | |
return mView; | |
} | |
} | |
class MainActivity extends AppCompatActivity { | |
@Inject | |
Presenter mPresenter; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
DaggerMainComponent.builder().viewModule(new ViewModule(this)).build().inject(this); | |
// boolean t = mPresenter == null; | |
// System.out.println(t); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment