@Override protected void onDestroy() { alertDialog.dismiss(); materialDialog.dismiss(); alertDialog = null; materialDialog = null; // NetStateReceiver.unRegisterNetworkStateReceiver(getApplicationContext()); NetStateReceiver.removeRegisterObserver(mNetChangeObserver); MApplication.getInstance().finishActivity(this); PreOnDestroy(); super.onDestroy(); }
@Override protected void onPause() { MApplication.getInstance().getmNewsLifecycleHandler().onActivityPaused(this); ThirdUtils.statisticsInActivityPause(this); if (alertDialog != null && alertDialog.isShowing()) { alertDialog.hide(); } if (materialDialog != null && materialDialog.isShowing()) { materialDialog.hide(); } PreOnPause(); super.onPause(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); materialDialog = new MaterialDialog(this); alertDialog = new SpotsDialog(this, R.style.CustomDialog); MApplication.getInstance().addActivity(this); mNetChangeObserver = new NetChangeObserver() { @Override public void onNetConnected(NetUtils.NetType type) { super.onNetConnected(type); onNetworkConnected(type); } @Override public void onNetDisConnect() { super.onNetDisConnect(); onNetworkDisConnected(); } }; NetStateReceiver.registerObserver(mNetChangeObserver); // NetStateReceiver.registerNetworkStateReceiver(getApplicationContext()); }
@Override protected void onStart() { MApplication.getInstance().getmNewsLifecycleHandler().onActivityStarted(this); PreOnStart(); super.onStart(); }