MainActivity继承了了common包下面的activity后,MainActicity里面没有了onCreate方法,程序在模拟器启动后就没有主界面
来源:3-9 初次体验MVP模式开发
Luyang_Xu
2018-03-07
public class MainActivity extends BaseActivity implements Iview{ @BindView(R.id.edit_input) EditText edit_input; @BindView(R.id.btn_submit) Button btn_submit; @BindView(R.id.text_info) TextView text_info; private Ipresenter presenter; @OnClick(R.id.btn_submit) public void search(){ Toast.makeText(this,"CLICK",Toast.LENGTH_LONG).show(); presenter.search(); } @Override protected void initData() { super.initData(); presenter = new Presenter(this); } // @Override // protected void onCreate(Bundle savedInstanceState) { // super.onCreate(savedInstanceState); // setContentView(R.layout.activity_main); // presenter = new Presenter(this); // } @Override protected int getContentLayoutId() { return R.layout.activity_main; } @Override public void setMessage(String info) { text_info.setText(info); } @Override public String getInput() { return edit_input.getText().toString(); } }
写回答
1回答
-
Qiujuer
2018-03-13
Common下面的Activity中没有调用ButterKnife的初始化方法,另外Common模块和app模块的build.gradle文件中都要加上ButterKnife的依赖才行,不然无法识别的哈。
00
相似问题