示例#1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    UmengUpdateAgent.setUpdateOnlyWifi(false);
    UmengUpdateAgent.update(this);
    setContentView(R.layout.activity_main);

    PushManager.getInstance().initialize(this.getApplicationContext());

    if (!Check.isNotFirstLoc(this)) {
      PreferencesUtils.putBooleanToSPMap(MainActivity.this, PreferencesUtils.Keys.IS_LOC, true);
      mLocationClient = new LocationClient(this.getApplicationContext());
      mMyLocationListener = new MyLocationListener();
      mLocationClient.registerLocationListener(mMyLocationListener);
      initLoc();
    }

    Intent intent = new Intent(this, CacheService.class);
    startService(intent);
    initData();
    findViewById();
    initUI();
    setListener();

    if (!Check.isNotFirst(this)) {
      startThread();
    }
  }
示例#2
0
  @Override
  protected void onDestroy() {
    super.onDestroy();
    if (mLocationClient != null && mLocationClient.isStarted()) {

      mLocationClient.stop();
    }
  }
示例#3
0
  @Override
  public void onAttachFragment(Fragment fragment) {

    try {
      if (fragment instanceof SignDayable) {
        mSingDay = (SignDayable) fragment;
      }
    } catch (Exception e) {
      throw new ClassCastException(this.toString() + " must implementOnMainListener");
    }
    super.onAttachFragment(fragment);
  }
示例#4
0
 @Override
 protected void onPause() {
   super.onPause();
   mIsExit = true;
 }