Example #1
0
  /*
   * (non-Javadoc)
   *
   * @see android.view.View.OnClickListener#onClick(android.view.View)
   */
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub
    switch (v.getId()) {
      case R.id.btn_left:
        if (isShowPost) {
          this.finish();
        } else {
          isShowPost = true;
          resumeShowPost();
        }
        break;
      case R.id.btn_collectPost:
        // 关注帖子
        if (isCollect) {
          MobclickAgent.onEvent(this, "cancleCollectPost");
        } else {
          MobclickAgent.onEvent(this, "collectPost");
        }
        collectPost();
        break;
      case R.id.btn_sharePost:
        // 分享帖子
        MobclickAgent.onEvent(this, "sharePost");
        sharePost();
        break;
      case R.id.btn_replyPost:
        isReplyPost = true;
        showReply();
        break;
      case R.id.btn_showOwner:
        if (isShowPost) {
          if (key.equals(type[0])) {
            key = type[1];
            btn_showOwner.setText("只看楼主");
          } else {
            key = type[0];
            btn_showOwner.setText("完整帖子");
          }
          webView.loadUrl(url + "&admin=" + key);
        } else {
          replyPost();
        }
        break;
      case R.id.btn_addPic:
        MobclickAgent.onEvent(this, "addPic_Reply");
        Intent intent =
            new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
        startActivityForResult(intent, GETPIC);
        break;

      case R.id.btn_rewardPost:
        MobclickAgent.onEvent(this, "rewardPost");
        rewardPost();
        break;

      default:
        break;
    }
  }
 public void onPause() {
   super.onPause();
   MobclickAgent.onPageEnd(
       "SplashScreen"); // (仅有Activity的应用中SDK自动调用,不需要单独写)保证 onPageEnd 在onPause 之前调用,因为 onPause
                        // 中会保存信息
   MobclickAgent.onPause(this);
 }
Example #3
0
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    getWindow().setFormat(PixelFormat.RGBA_8888);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);

    setContentView(R.layout.splashscreen);

    com.umeng.socialize.utils.Log.LOG = true;
    MobclickAgent.updateOnlineConfig(this);
    MobclickAgent.setOnlineConfigureListener(
        new UmengOnlineConfigureListener() {
          @Override
          public void onDataReceived(JSONObject data) {}
        });

    LocationUtil mApplication = LocationUtil.getInstance(splashScreen.this);
    new Handler()
        .postDelayed(
            new Runnable() {
              public void run() {
                /* Create an Intent that will start the Main WordPress Activity. */
                Intent mainIntent = new Intent(splashScreen.this, MainActivity.class);
                mainIntent.putExtra(
                    "TEXT",
                    splashScreen.this.getResources().getString(R.string.title_transparent_desc));
                mainIntent.putExtra(
                    AbConstant.TITLE_TRANSPARENT_FLAG, AbConstant.TITLE_TRANSPARENT);
                splashScreen.this.startActivity(mainIntent);
                splashScreen.this.finish();
              }
            },
            2900); // 2900 for release
  }
 @Override
 protected void onPause() {
   // TODO Auto-generated method stub
   super.onPause();
   MobclickAgent.onPageEnd(this.getClass().getName());
   MobclickAgent.onPause(this);
 }
 @Override
 protected void onResume() {
   super.onResume();
   MobclickAgent.onPageStart(
       "添加好友页"); // 统计页面(仅有Activity的应用中SDK自动调用,不需要单独写。"SplashScreen"为页面名称,可自定义)
   MobclickAgent.onResume(this); // 统计时长
 }
        @Override
        public void onCheckedChanged(RadioGroup group, int checkedId) {
          switch (checkedId) {
            case R.id.chebox_Every_day:

              // chebox_Every_day.setChecked(true);

              MobclickAgent.onEvent(context, "position_subscriber_sets_push_frequency_day");
              value = (String) chebox_Every_day.getText();
              break;

            case R.id.chebox_Every_weeky:
              MobclickAgent.onEvent(context, "position_subscriber_sets_push_frequency_week");
              value = (String) chebox_Every_weeky.getText();
              break;

            case R.id.chebox_Every_weekys:
              MobclickAgent.onEvent(context, "position_subscriber_sets_push_frequency_2week");
              value = (String) chebox_Every_weekys.getText();
              break;

            case R.id.chebox_Every_month:
              MobclickAgent.onEvent(context, "position_subscriber_sets_push_frequency_moonth");
              value = (String) chebox_Every_month.getText();
              break;
          }
        }
Example #7
0
 @Override
 protected void onPause() {
   MobclickAgent.onPageEnd(
       TAG); // (仅有Activity的应用中SDK自动调用,不需要单独写)保证 onPageEnd 在onPause 之前调用,因为 onPause 中会保存信息
   MobclickAgent.onPause(this);
   super.onPause();
 }
  @Override
  public void onCreate() {
    super.onCreate();
    //        if (isDexProcess()) {
    //            return;
    //        }

    if (BuildConfig.LOG_DEBUG) {
      LeakCanary.install(this);
      //            BlockCanary.install(this, new NoteBlockCanaryContext(this)).start();
      AndroidDevMetrics.initWith(this);
    }

    initComponent();
    Utils.init(this);
    initImageLoader();
    FilePathUtils.initEnvironment(this);

    // 打点
    MobclickAgent.setDebugMode(BuildConfig.LOG_DEBUG);
    MobclickAgent.openActivityDurationTrack(true);
    MobclickAgent.updateOnlineConfig(this);
    MobclickAgent.setCatchUncaughtExceptions(!BuildConfig.LOG_DEBUG);

    //        CrashHandler.getInstance().init(getApplicationContext());

    YLog.setDEBUG(BuildConfig.LOG_DEBUG);
  }
Example #9
0
 @Override
 protected void onPause() {
   super.onPause();
   MobclickAgent.onPageEnd(getClass().getSimpleName()); // 保证 onPageEnd
   // 在onPause
   MobclickAgent.onPause(this);
 }
 @Override
 protected void onPause() {
   super.onPause();
   MobclickAgent.onPageEnd(
       "我的助人页"); // (仅有Activity的应用中SDK自动调用,不需要单独写)保证 onPageEnd 在onPause 之前调用,因为 onPause
   // 中会保存信息。"SplashScreen"为页面名称,可自定义
   MobclickAgent.onPause(this);
 }
Example #11
0
 @Override
 protected void submitData() {
   String eventName = "open_wap_bank_topup";
   MobclickAgent.onEvent(this, eventName);
   besttoneEventCommint(eventName);
   String eventName1 = "open_topup";
   MobclickAgent.onEvent(this, eventName1, "wap_bank");
 }
 public void onPause() {
   super.onPause();
   MobclickAgent.onPageEnd(
       this.getClass()
           .getSimpleName()); // (仅有Activity的应用中SDK自动调用,不需要单独写)保证 onPageEnd 在onPause 之前调用,因为
   // onPause 中会保存信息
   MobclickAgent.onPause(this);
 }
 @Override
 protected void onResume() {
   super.onResume();
   if (EcmobileManager.getUmengKey(this) != null) {
     MobclickAgent.onPageStart("CategoryList");
     MobclickAgent.onResume(this, EcmobileManager.getUmengKey(this), "");
   }
 }
 @Override
 protected void onPause() {
   super.onPause();
   if (EcmobileManager.getUmengKey(this) != null) {
     MobclickAgent.onPageEnd("CategoryList");
     MobclickAgent.onPause(this);
   }
 }
  @Override
  protected void onResume() {
    super.onResume();
    Log.d("SettingCfgActivity", "onResume");

    MobclickAgent.onPageStart("setting");
    MobclickAgent.onResume(this);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.gba);
    MobclickAgent.onError(this);

    NotificationManager notificationManager =
        (NotificationManager) this.getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancel(Constant.alarmId);
    Intent intent = getIntent();

    boolean isNotification = intent.getBooleanExtra("isNotification", false);
    Logs.i("=== isNotification " + isNotification);

    String pType = intent.getStringExtra("nType");
    String pid = intent.getStringExtra("pId");
    String id = intent.getStringExtra("id");
    Logs.i("=== pType " + pType);
    if (isNotification) { // ͳ¼ÆÍÆËÍ
      Map<String, String> map = new HashMap<String, String>();
      map.put("pID", pid);
      map.put("platform", "android");
      map.put("deviceToken", Util.getDeviceId(context));
      MobclickAgent.onEvent(this, "PushEvent", map); // "SimpleButtonclick");
      uploadLoginLogNew("PushEvent", pid, "pID", null);
    }
    // unknow = 0,
    // 论文信息 = 1,
    // 问卷调查 = 2,
    // 医学新闻 = 3,
    // 用药安全 = 4,
    // 专题新闻 = 5
    if (isNotification) {
      PushConst.pushFlag = true;
      if (!TextUtils.isEmpty(pType) && pType.equals("3")) {
        PushConst.pushmodule = PushConst.News_MODULE;
      } else if (!TextUtils.isEmpty(pType) && pType.equals("1")) {
        PushConst.pushmodule = PushConst.RESEARCH_MODULE;
      } else if (!TextUtils.isEmpty(pType) && pType.equals("###")) {
        PushConst.pushmodule = PushConst.RESEARCH_MODULE;
      }
      PushConst.id = id;
    }
    inits();
    if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
      showDialog(DialogRes.DIALOG_ID_SDCARD_NOT_AVAILABLE);
    } else {
      if (checkUserInfo()) {
        skipToNextPage();
      } else {
        if (!checkUserInfo()) {
          Intent intent1 = new Intent(this, FirstStartForChooseActivity.class);
          startActivity(intent1);
        }
      }
    }
  }
Example #17
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   //		new UpgradeManager(this).checkandupdate();
   MobclickAgent.updateOnlineConfig(this);
   MobclickAgent.openActivityDurationTrack(false);
   initContentview();
   initMenuview();
 }
 @Override
 protected void onResume() {
   super.onResume();
   MobclickAgent.onPageStart(mPageName);
   MobclickAgent.onResume(this);
   initWidget();
   initData();
   loadData();
 }
Example #19
0
 @Override
 protected void onResume() {
   super.onResume();
   Const.Application.setCurrentActivity(this);
   Const.Application.setActivityOnStart(this);
   MobclickAgent.onPageStart(this.getClass().getSimpleName());
   MobclickAgent.onResume(this);
   //		DebugLogger.write("onResume " + this);
 }
Example #20
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    if (drawerToggle != null && drawerToggle.onOptionsItemSelected(item)) return true;

    if (android.R.id.home == item.getItemId()) {
      if (mDrawerLayout.isDrawerVisible(GravityCompat.START)) mDrawerLayout.closeDrawers();
      else mDrawerLayout.openDrawer(GravityCompat.START);

      return true;
    }

    // 关于
    //        if (item.getItemId() == R.id.about)
    //            AboutWebFragment.launchAbout(this);
    // 意见反馈
    //        else if (item.getItemId() == R.id.feedback)
    //            PublishActivity.publishFeedback(this);
    // 退出
    if (item.getItemId() == R.id.exitapp) {
      finish();

      MobclickAgent.onEvent(this, "exitapp");
    }
    // 新微博
    else if (item.getItemId() == R.id.publish) PublishActivity.publishStatus(this, null);
    // 开始离线
    else if (item.getItemId() == R.id.toggle_offline) {
      OfflineUtils.toggleOffline(this);

      MobclickAgent.onEvent(this, "toggle_offline");
    }
    // 停止离线
    else if (item.getItemId() == R.id.stop_offline) {
      OfflineService.stopOffline();

      MobclickAgent.onEvent(this, "stop_offline");
    }
    // 通知设置
    else if (item.getItemId() == R.id.notification_settings)
      NotificationSettingsFragment.launch(this);
    // 搜索
    else if (item.getItemId() == R.id.search) {
      new IAction(
          MainActivity.this,
          new WebLoginAction(MainActivity.this, BizFragment.createBizFragment(this))) {

        @Override
        public void doAction() {
          SearchFragment.launch(MainActivity.this, "");

          MobclickAgent.onEvent(MainActivity.this, "toggle_search");
        }
      }.run();
    }

    return super.onOptionsItemSelected(item);
  }
Example #21
0
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setLotno(Constants.LOTNO_SSQ);

    init(titles, topTitles, allId);
    setIssue(Constants.LOTNO_SSQ);
    setlastbatchcode(Constants.LOTNO_SSQ);
    MobclickAgent.onEvent(this, "shuangseqiu"); // BY贺思明 点击首页的“双色球”图标
    MobclickAgent.onEvent(this, "fucaigoucaijiemian"); // BY贺思明 福彩购彩页面
  }
Example #22
0
  /** 友盟数据统计 */
  private void initUmengStatistics() {
    MobclickAgent.setDebugMode(true);
    // SDK在统计Fragment时,需要关闭Activity自带的页面统计,
    // 然后在每个页面中重新集成页面统计的代码(包括调用了 onResume 和 onPause 的Activity)。
    MobclickAgent.openActivityDurationTrack(false);
    // MobclickAgent.setAutoLocation(true);
    // MobclickAgent.setSessionContinueMillis(1000);

    MobclickAgent.updateOnlineConfig(this);
  }
 /**
  * @param context
  * @param isDebug
  */
 public static void init(Context context, boolean isDebug) {
   com.umeng.common.Log.LOG = isDebug;
   MobclickAgent.setDebugMode(isDebug);
   MobclickAgent.setAutoLocation(true);
   MobclickAgent.setSessionContinueMillis(1000);
   // MobclickAgent.setUpdateOnlyWifi(false);
   // MobclickAgent.setDefaultReportPolicy(context,
   // ReportPolicy.BATCH_BY_INTERVAL, 5*1000);
   MobclickAgent.updateOnlineConfig(context);
   MobclickAgent.onError(context);
 }
Example #24
0
 @Override
 protected void onPause() {
   //		DebugLogger.write("onPause " + this);
   if (mLoading != null) {
     mLoading.forceStop();
   }
   MobclickAgent.onPause(this);
   MobclickAgent.onPageEnd(this.getClass().getSimpleName());
   Const.Application.setActivityOnStop(this);
   super.onPause();
 }
  @Override
  public void onPause() {
    if (isFirstRun) {
      isFirstRun = false;
      AdvertService.eventEnterSetting(this);
      AdvertService.checkActiveState(LiveWallpaperSettingsCfgActivity.this);
    }

    super.onPause();
    Log.d("SettingCfgActivity", "onPause");
    MobclickAgent.onPageEnd("setting");
    MobclickAgent.onPause(this);
  }
Example #26
0
 @Override
 public void onCreate() {
   super.onCreate();
   mApp = this;
   mService = new GlobalServiceMger(AppService.class);
   initImageLoader(getApplicationContext());
   MobclickAgent.openActivityDurationTrack(false);
   MobclickAgent.setDebugMode(false);
   UrlUtils.initUrlBase(ValConfig.URL_BASE_RELEASE, ValConfig.URL_BASE_DEBUG);
   mLocalBroadcast = new Receiver();
   mLocalBroadcast.toggleLocalBroadcast(this, true);
   boolean needUpdate = new InitHelper(this).initUpdate();
   d("onCreate", "update database before 3.0 is " + needUpdate);
 }
Example #27
0
 @Override
 public void onFalse(int requestCode, String msg) {
   feedback(false, false);
   hideProgress();
   isUpload = false;
   switch (requestCode) {
     case REQUEST_UPLOADPIC:
       MobclickAgent.onEvent(this, "uploadQP_F");
       break;
     case REQUEST_UPLOADQUESTION:
       MobclickAgent.onEvent(this, "upload_F");
       break;
   }
   Log.e("UQ", msg);
 }
Example #28
0
  /** 晒厨艺-入口 */
  public static void onEventCookShowIn() {
    Object from = getLogMarker(MARK.FROM);
    if (from != null) {
      Map<String, Object> keys = new HashMap<String, Object>();
      keys.put(LOG_ZHUGE.EV_COOKSHOW_GOIN_KEY_FROM, from);
      ZhugeSDK.getInstance()
          .onEvent(BaseApp.getApplication(), LOG_ZHUGE.EV_COOKSHOW_GOIN, new JSONObject(keys));

      if ("功能快捷区".equals(from)) {
        MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.RECOMMEND_COOKSHOW_CLICK);
      } else if ("首页晒厨艺".equals(from)) {
        MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.COOK_RECOMMEND_DO);
      }
    }
  }
 private void revertMode() {
   SharedPreferencesUtil.saveBoolean(
       Consts.Key_Is_Night_Mode,
       !SharedPreferencesUtil.readBoolean(Consts.Key_Is_Night_Mode, false));
   MobclickAgent.onEvent(getActivity(), Mob.Event_Switch_Day_Night_Mode);
   getActivity().recreate();
 }
Example #30
0
  public void onResume() {
    super.onResume();
    // umeng统计
    MobclickAgent.onResume(this);
    //	if ( !GezitechApplication.isActive ) {
    // app 从后台唤醒,进入前台
    //   GezitechApplication.isActive = true;
    // 判断xmpp是否链接
    User user = GezitechService.getInstance().getCurrentLoginUser(this);
    if (user != null) {
      if (GezitechApplication.connection == null
          || (!GezitechApplication.connection.isConnected())
          || (XmppConnectionManager.getInstance().getConnection() != null
              && !XmppConnectionManager.getInstance().getConnection().isConnected())) {
        XmppConnectionManager.getInstance().login();
      }
    }
    /*//是否重新启动app
    if( GezitechApplication.runtime>0 && (System.currentTimeMillis() - GezitechApplication.runtime) > 30*60*1000  ){
    	Intent intent = new Intent(this, WelcomeActivity.class);
    	startActivity( intent );
    	GezitechService.getInstance().exitApp( this );
    }*/
    //	}
    // 过半个小时定位一次
    long currTime = System.currentTimeMillis();
    long LBSCtime = GezitechApplication.systemSp.getLong("LBSCtime", currTime);
    if (AppUtils.isAppOnForeground() && (currTime - LBSCtime) > 35 * 60) {

      GezitechService.getInstance().longitude();
    }
    getNewNearByCount();
  }