package com.example.week03demo01;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
/**
* @Author:巴啦啦能量魔仙变
* @E-mail: 1484364578@163.com
* @Date:2019/3/1 10:54
* @Description:描述信息
*/
public abstract class BaseActivity extends AppCompatActivity implements View.OnClickListener {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//加载布局
setContentView(initLayout());
//加载控件
initView();
//加载数据
initData();
}
//加载布局
public abstract int initLayout();
//加载控件
public abstract void initView();
//加载数据
public abstract void initData();
//findViewById
public <T extends View> T fvbi(int resId){
return (T)findViewById(resId);
}
}