@Override public void exitActivity() { L.d(TAG, "Function is exitActivity"); // 取消注册EventBus if (isRegisterEventBus) { L.i(TAG, "----------取消注册EventBus----------"); EventBus.getDefault().unregister(this); } // 销毁Activity绑定的ProgressDialog if (progressDialog != null && progressDialog.isShowing()) { progressDialog.dismiss(); } try { TypeWriteUtils.changeInputBoradState(getCurActivity()); } catch (Exception e) { e.printStackTrace(); } ActivityHelper.getActivityHelper().finishActivity(this); }
@Override protected void onCreate(Bundle savedInstanceState) { // 注册eventBus isRegisterEventBus = registerEventBus(); if (isRegisterEventBus) { L.i(TAG, "----------注册EventBus----------"); EventBus.getDefault().register(this); } super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); progressDialog = new ProgressDialog(this, R.style.MyDialog); progressDialog.setMessage("正在加载..."); progressDialog.setCancelable(false); progressDialog.setCanceledOnTouchOutside(false); // progressDialog = ProgressDialog.show(this, null, "正在加载..."); initView(null, null); initData(); addListener(); // 新建ProgressDialog // 必须放在最后,因为在Loading界面会结束所有Activity界面 ActivityHelper.getActivityHelper().addActivity(this); }