mirror of
https://github.com/WuXiaolong/AndroidMVPSample.git
synced 2025-12-20 10:35:41 +08:00
structure
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user