Beispiel #1
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   NoticeUtils.unbindFromService(this);
   unregisterReceiver(mReceiver);
   mReceiver = null;
   NoticeUtils.tryToShutDown(this);
 }
Beispiel #2
0
  @Override
  public void initView() {
    mDoubleClickExit = new DoubleClickExitHelper(this);
    mNavigationDrawerFragment =
        (NavigationDrawerFragment)
            getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
    mTitle = getTitle();

    // Set up the drawer.
    mNavigationDrawerFragment.setUp(
        R.id.navigation_drawer, (DrawerLayout) findViewById(R.id.drawer_layout));

    mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);
    if (android.os.Build.VERSION.SDK_INT > 10) {
      mTabHost.getTabWidget().setShowDividers(0);
    }

    initTabs();

    // 中间按键图片触发
    mAddBt.setOnClickListener(this);

    mTabHost.setCurrentTab(0);
    mTabHost.setOnTabChangedListener(this);

    IntentFilter filter = new IntentFilter(Constants.INTENT_ACTION_NOTICE);
    filter.addAction(Constants.INTENT_ACTION_LOGOUT);
    registerReceiver(mReceiver, filter);
    NoticeUtils.bindToService(this);

    if (AppContext.isFristStart()) {
      mNavigationDrawerFragment.openDrawerMenu();
      DataCleanManager.cleanInternalCache(AppContext.getInstance());
      AppContext.setFristStart(false);
    }

    checkUpdate();
  }