5.28学习记录

主类的修改
**
* 描述: Activity基类
* 作者: 王克
* 日期: 2021/5/26 15:42
* 类名: BaseActivity
*/
public abstract class BaseActivity extends PermissionActivity {

protected String TAG = BaseActivity.class.getSimpleName();
protected boolean isActive = true; //是否活跃

private InputMethodManager imm;

private static final int DISMISS = 1001;
private static final int SHOW = 1002;
private CustomProgressDialog progressDialog = null;

protected ProgressDialog mProgressDialog;

protected InputMethodManager inputMethodManager;

protected Context context;

@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {

@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case SHOW:
if (progressDialog != null) {
progressDialog.setTouchAble((Boolean) msg.obj);
progressDialog.show();
}
break;
case DISMISS:
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
break;
default:
break;
}
}
};

@Override
原文地址:https://www.cnblogs.com/blog-wangke/p/14871825.html