package com.hw.nativeapp.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;

import androidx.annotation.Nullable;

import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * 应用界面基类
 */
public abstract class BaseActivity extends Activity {

    protected String TAG;

    private Unbinder unbinder;

    abstract void  initView();


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        if (TextUtils.isEmpty(TAG)) {
            TAG = getClass().getSimpleName();
        }
        super.onCreate(savedInstanceState);
    }

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        unbinder = ButterKnife.bind(this);
        initView();
    }



    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (unbinder != null) {
            unbinder.unbind();
        }
    }


}
