You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
846 B

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() {
}
}