1
0
mirror of https://github.com/WuXiaolong/AndroidMVPSample.git synced 2025-12-20 10:35:41 +08:00

structure

This commit is contained in:
WuXiaolong
2016-01-14 09:43:36 +08:00
parent 5feb982b54
commit 67dd043adf
3 changed files with 7 additions and 11 deletions

View File

@@ -17,6 +17,10 @@ import cz.msebera.android.httpclient.Header;
public class MainPresenter implements Presenter<MainView> {
private MainView mMainView;
public MainPresenter(MainView view) {
attachView(view);
}
@Override
public void attachView(MainView view) {
this.mMainView = view;

View File

@@ -29,8 +29,7 @@ public class MainActivity extends AppCompatActivity implements MainView {
private void initView() {
text = (TextView) findViewById(R.id.text);
mProgressBar = (ProgressBar) findViewById(R.id.mProgressBar);
mMainPresenter = new MainPresenter();
mMainPresenter.attachView(this);
mMainPresenter = new MainPresenter(this);
mMainPresenter.loadData();
}