コード例 #1
0
 @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();
 }
コード例 #2
0
 @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();
 }
コード例 #3
0
  @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());
  }
コード例 #4
0
 @Override
 protected void onStart() {
   MApplication.getInstance().getmNewsLifecycleHandler().onActivityStarted(this);
   PreOnStart();
   super.onStart();
 }