parent
34994574e7
commit
92e6da17e0
@ -0,0 +1,49 @@
|
|||||||
|
package com.example.activity;
|
||||||
|
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
|
public abstract class BaseActivity extends FragmentActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(getLayoutId());
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
|
getPreIntent();
|
||||||
|
initView();
|
||||||
|
initData();
|
||||||
|
initListener();
|
||||||
|
}
|
||||||
|
abstract int getLayoutId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取上一个页面传递来的 intent 数据
|
||||||
|
*/
|
||||||
|
void getPreIntent() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化View
|
||||||
|
*/
|
||||||
|
void initView() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化界面数据
|
||||||
|
*/
|
||||||
|
void initData() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定监听器与适配器
|
||||||
|
*/
|
||||||
|
void initListener() {
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue