コード例 #1
0
 protected void onDestroy() {
   MojiLog.v("WeatherMainActivity", "onDestroy");
   super.onDestroy();
   if (mWeathearTabCallBackImpl != null)
     WeatherTabPublisher.getInstance().unSubscribe(mWeathearTabCallBackImpl);
   mCityWeatherBgSwitcher.removeTimer();
   checkStopBroadcast();
 }
コード例 #2
0
  private void addUmengAd() {
    mExchangeViewManager = new ExchangeViewManager(this);
    if (sReportListner == null)
      sReportListner =
          new com.adm.controller.ReportThread.ReportListener() {

            public void onReportEnd(int i) {
              MojiLog.d("WeatherMainActivity", "onReportEnd");
            }

            public void onReportStart(Map map) {
              StringBuffer stringbuffer = new StringBuffer();
              Iterator iterator = map.keySet().iterator();
              do {
                if (!iterator.hasNext()) break;
                String s = (String) iterator.next();
                MojiLog.d("exchange_demo", stringbuffer.toString());
                stringbuffer.append(
                    (new StringBuilder())
                        .append(s)
                        .append(": ")
                        .append(map.get(s).toString())
                        .toString());
                if (stringbuffer.toString().equals("action_type: 3")
                    || stringbuffer.toString().equals("action_type: 7")) {
                  StatsUtil.updateStatsAdDown();
                  MojiLog.d("WeatherMainActivity", "AdDown + 1");
                } else if (stringbuffer.toString().equals("action_type: 0")) {
                  StatsUtil.updateStatsAdView();
                  MojiLog.d("WeatherMainActivity", "AdArea + 1");
                }
              } while (true);
            }
          };
    ReportThread.unregisterReportListener(sReportListner);
    ReportThread.registerReportListener(sReportListner);
    ExchangeConstants.ONLY_CHINESE = false;
    MojiLog.d(
        "WeatherMainActivity",
        (new StringBuilder()).append("AdOn = ").append(Gl.getAdON()).toString());
    if (Gl.getAdON()) {
      mAdUmeng.setVisibility(0);
      Drawable drawable = getResources().getDrawable(0x7f02016d);
      ExchangeViewManager exchangeviewmanager = mExchangeViewManager;
      ImageView imageview = mAdUmeng;
      Drawable adrawable[] = new Drawable[1];
      adrawable[0] = drawable;
      exchangeviewmanager.addView(7, imageview, adrawable);
    } else {
      mAdUmeng.setVisibility(8);
    }
  }
コード例 #3
0
 protected void onCreate(Bundle bundle) {
   super.onCreate(bundle);
   MojiLog.v("WeatherMainActivity", "onCreate");
   initWindow();
   setContentView(0x7f03004f);
   initMain();
   forFirstRun();
   checkTuorialDisplay();
   addUmengAd();
   subscribeWeathertabCallBack();
   mFadeAnim = AnimationUtils.loadAnimation(this, 0x7f040008);
   mFadeAnim.setDuration(300L);
 }
コード例 #4
0
 protected void onResume() {
   super.onResume();
   MojiLog.v("WeatherMainActivity", "onResume");
   if (android.os.Build.VERSION.SDK_INT > 4)
     if (mIsFromCityView) {
       mIsFromCityView = false;
       if (mCurrentCityIdx != Gl.getCurrentCityIndex()) {
         mCurrentCityIdx = Gl.getCurrentCityIndex();
         ((ViewGroup) findViewById(0x7f0d01d7)).startAnimation(mFadeAnim);
       }
     } else {
       ((ViewGroup) findViewById(0x7f0d01d7)).startAnimation(mFadeAnim);
     }
   StatsUtil.updateStatsPv(com.moji.mjweather.util.StatsUtil.StatsPv.PV_WW);
 }
コード例 #5
0
 protected void onStop() {
   MojiLog.v("WeatherMainActivity", "onStop");
   super.onStop();
   Gl.saveCurrentCityIndex(Gl.getCurrentCityIndex());
 }
コード例 #6
0
 protected void onPause() {
   super.onPause();
   MojiLog.v("WeatherMainActivity", "onPause");
   if (isUpdating) cancelUpdateWeather(null, true);
 }