@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; } }
/* * (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; } }
@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"); }
@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); }
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贺思明 福彩购彩页面 }
/** 晒厨艺-入口 */ 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); } } }
@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); }
private void showReply() { isShowPost = false; btn_showOwner.setText("发 布"); btn_showOwner.setVisibility(View.VISIBLE); showKeyboard(null); if (isReplyPost) { MobclickAgent.onEvent(this, "replyPost"); tv_title.setText("跟帖"); } else { MobclickAgent.onEvent(this, "replyFoolr"); tv_title.setText("回复"); } post_layout.setVisibility(View.GONE); reply_layout.setVisibility(View.VISIBLE); showKeyboard(null); }
private void countCalendarClick(FinanceCalendar calendar) { Map<String, String> extra = new HashMap<>(1); extra.put("title", calendar.ecName); MobclickAgent.onEvent(getActivity(), EventIDS.QUOTE_CALENDAR_CLICK, extra); Tracker.getInstance(getActivity()) .addLog(new LogData.Builder(getActivity()).pv(EventIDS.QUOTE_CALENDAR_CLICK).append(extra)); }
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(); }
private void saveImage(int index) { String dest = AcApp.getPreferenceImageSaveDir(); String path = mList.get(index); Uri uri = Uri.parse(path); File saveFile; if (uri.getScheme().equals("http")) { // FIXME: volley 的缓存任务还没有被执行的时候是会获取不到数据的 byte[] diskCache = AcApp.getDataInDiskCache(path); if (diskCache != null) { saveFile = new File(dest + "/" + FileUtil.getHashName(path)); if (!FileUtil.save(diskCache, saveFile.getAbsolutePath())) { saveFile = null; } } else { File cache = FileUtil.generateImageCacheFile(path); saveFile = FileUtil.copy(cache, dest); } } else { File cache = new File(uri.getPath()); saveFile = FileUtil.copy(cache, dest); } if (saveFile != null && saveFile.exists()) { MobclickAgent.onEvent(this, "save_pic"); Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(saveFile)); sendBroadcast(intent); AcApp.showToast(getString(R.string.save_success) + ":" + saveFile.getAbsolutePath()); } else AcApp.showToast(getString(R.string.save_failed)); }
@Override protected void onCreate(Bundle savedInstanceState) { ActionBarUtil.compatibleDeviceWithSB(this); requestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState); ActionBarUtil.setXiaomiFilterDisplayOptions(getSupportActionBar(), false); getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_bg_trans)); Bundle extras = getIntent().getExtras(); title = extras.getString("title"); getSupportActionBar().setTitle(title); aid = extras.getInt("aid"); mList = extras.getStringArrayList(EXTRA_IMAGES); int index = extras.getInt(EXTRA_INDEX, 0); MobclickAgent.onEvent(this, "view_big_pic"); setContentView(R.layout.activity_images); indexText = (TextView) findViewById(R.id.index); if (ActionBarUtil.hasSB() && getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) { setInfoBottomMargin( getResources().getDimensionPixelSize(R.dimen.abc_action_bar_default_height)); } pager = (MyViewPager) findViewById(R.id.pager); pager.setAdapter(new ImageAdapter(getSupportFragmentManager(), mList)); pager.setOffscreenPageLimit(1); pager.setOnPageChangeListener(this); pager.setCurrentItem(index); onPageSelected(index); }
private void recommend() { if (!UserAPI.isLoggedIn()) { notifyNeedLog(); } else { MobclickAgent.onEvent(this, Mob.Event_Recommend_Question); InputDialog.Builder builder = new InputDialog.Builder(this); builder.setTitle(R.string.recommend_question); builder.setCancelable(true); builder.setCanceledOnTouchOutside(false); builder.setOnClickListener( new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (which == DialogInterface.BUTTON_POSITIVE) { InputDialog d = (InputDialog) dialog; String text = d.InputString; RecommendTask recommendTask = new RecommendTask(); recommendTask.executeOnExecutor( AsyncTask.THREAD_POOL_EXECUTOR, question.getId(), question.getTitle(), question.getSummary(), text); } } }); InputDialog inputDialog = builder.create(); inputDialog.show(); } }
/** * Create shortcut in home screen. * * @param appName * @param packageName * @param activityName */ private void createShortcut( String appName, String packageName, String activityName, Parcelable value) { try { Intent shortcutIntent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT"); shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, appName); shortcutIntent.putExtra("duplicate", true); Intent intent = new Intent(Intent.ACTION_MAIN); intent.setComponent(new ComponentName(packageName, activityName)); shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent); if (value instanceof Bitmap) { shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON, value); } else { shortcutIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, value); } sendBroadcast(shortcutIntent); // statistic analysis for Shortcut created App MobclickAgent.onEvent(getApplicationContext(), "PickedAppName", appName); // TODO Change to Dialog Toast.makeText(this, "Create Shortcut Success! ", Toast.LENGTH_SHORT).show(); } catch (Exception e) { e.printStackTrace(); } }
private void countChangeLineType() { Map<String, String> extra = new HashMap<String, String>(1); extra.put("period", this.lineType); MobclickAgent.onEvent(getActivity(), EventIDS.QUOTE_PERIOD_CLICK, extra); Tracker.getInstance(getActivity()) .addLog(new LogData.Builder(getActivity()).pv(EventIDS.QUOTE_PERIOD_CLICK).append(extra)); }
public static void statsReport( Context context, String eventId, String key, String value, String key1, String value1) { HashMap<String, String> statsData = new HashMap<String, String>(); statsData.put(key, value); statsData.put(key1, value1); MobclickAgent.onEvent(context, eventId, statsData); }
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (resultCode) { case RESULT_OK: if (requestCode == REQUEST_GETPIC) { getPic(data); } else { uploadQuestion(); } break; default: if (requestCode == REQUEST_GETPIC) { MobclickAgent.onEvent(this, "addQP_F"); } break; } /*if (resultCode == RESULT_OK) { switch (requestCode) { case REQUEST_GETPIC: getPic(data); break; case REQUEST_LOGIN: uploadQuestion(); break; } }*/ }
private void favor() { if (!UserAPI.isLoggedIn()) { notifyNeedLog(); } else { MobclickAgent.onEvent(this, Mob.Event_Favor_Question); new FavorDialog.Builder(this).setTitle(R.string.action_favor).create(question).show(); } }
/** 组菜-入口 */ public static void onEventGarnishIn() { Object from = getLogMarker(MARK.FROM); if (from != null) { Map<String, Object> keys = new HashMap<String, Object>(); keys.put(LOG_ZHUGE.EV_GARNISH_GOIN_KEY_FROM, from); ZhugeSDK.getInstance() .onEvent(BaseApp.getApplication(), LOG_ZHUGE.EV_GARNISH_GOIN, new JSONObject(keys)); if ("快捷区".equals(from)) { MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.RECOMMEND_GARNISH_CLICK); } else if ("厨房".equals(from)) { Map<String, String> map = new HashMap<String, String>(); map.put(LogConstant.KEY_TO, LogConstant.TO_INSPIRE_SEARCH); MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.UBS_KITCHEN_ENTER_COUNT, map); } } }
/** 上传菜谱-入口 */ public static void onEventPublishIn() { Object from = getLogMarker(MARK.FROM); if (from != null) { Map<String, Object> keys = new HashMap<String, Object>(); keys.put(LOG_ZHUGE.EV_PUBLISH_GOIN_KEY_FROM, from); ZhugeSDK.getInstance() .onEvent(BaseApp.getApplication(), LOG_ZHUGE.EV_PUBLISH_GOIN, new JSONObject(keys)); if ("快捷区".equals(from)) { MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.RECOMMEND_NEW_RECIPE_CLICK); } else if ("我的菜谱".equals(from)) { MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.NEW_RECIPE_MYRECIPE_ENTER); } else if ("精品菜谱".equals(from)) { MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.NEW_RECIPE_RECOMMEND_ENTER); } } }
public void handleMessage(Message msg) { switch (msg.what) { case 1: progressDialog.dismiss(); Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); regToLogin(phonenum, password, "0", packageName); break; case 2: progressDialog.dismiss(); Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); break; case 3: progressDialog.dismiss(); Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); break; case 4: Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); break; case 5: progressDialog.dismiss(); Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); break; case 6: progressDialog.dismiss(); Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); break; case 7: progressDialog.dismiss(); password_edit.startAnimation(shake); Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); break; case 8: progressDialog.dismiss(); Toast.makeText(getBaseContext(), "网络异常!", Toast.LENGTH_LONG).show(); break; case 9: progressDialog.dismiss(); Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); break; case 10: progressDialog.dismiss(); MobclickAgent.onEvent(UserLogin.this, "dengluchenggong"); // BY贺思明 // 登陆成功 Toast.makeText(getBaseContext(), message, Toast.LENGTH_LONG).show(); if (b == true) { Intent intent = new Intent(SUCCESS); sendBroadcast(intent); PublicConst.islogin = true; UserLogin.this.setResult(RESULT_OK); UserLogin.this.finish(); } break; case 20: // 微博获取昵称后登陆 progressDialog.dismiss(); sinaweibologin(); break; } }
@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); } } } }
private void getPic(Intent data) { if (null != data) { // 取出所选图片的路径 Uri selectedImage = data.getData(); String[] filePathColumn = {MediaStore.Images.Media.DATA}; Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); String picuri = cursor.getString(columnIndex); cursor.close(); // 将图片贴到控件上 BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(picuri, options); int width = options.outWidth; int height = options.outHeight; if (100 > width || 40 > height) { // 图片分辨率太低 Toast.makeText(this, getString(R.string.question_imagetoosmall), Toast.LENGTH_SHORT).show(); MobclickAgent.onEvent(this, "addQP_F"); return; } BitmapFactory.Options opts = new BitmapFactory.Options(); opts.inJustDecodeBounds = true; BitmapFactory.decodeFile(picuri, opts); opts.inSampleSize = computeSampleSize(opts, -1, 700 * 272); opts.inJustDecodeBounds = false; try { bitmap = BitmapFactory.decodeFile(picuri, opts); } catch (OutOfMemoryError err) { // showNotification("图片过大!"); MobclickAgent.onEvent(this, "addQP_F"); Toast.makeText(this, getString(R.string.question_imagetoolarge), Toast.LENGTH_SHORT).show(); return; } MobclickAgent.onEvent(this, "addQP_S"); image.setScaleType(ImageView.ScaleType.FIT_CENTER); image.setImageBitmap(bitmap); hint.setText(getString(R.string.question_removeimage_hint)); } }
@Override public void onSuccess() { isUpload = false; MobclickAgent.onEvent(this, "upload_S"); hideProgress(); mApplication.user.setUploadNum(mApplication.user.getUploadNum() + 1); setResult(RESULT_OK); this.finish(); }
@Override public void resultTopAvailable(int status, AbstractDataResult<Base> result) { if (status == REQUEST_SUCCESS) { MobclickAgent.onEvent( mActivity, EventContants.com, EventContants.communicate_topicListSuccess); mValues.clear(); mCallback.clear(); mValues.addAll(result.values); mCallback.refreshTop(result.values); } else if (status == REQUEST_FAILED) { MobclickAgent.onEvent(mActivity, EventContants.com, EventContants.communicate_topicListFail); // 错误处理 mCallback.refreshTop(null); mTxtMessage.setText(""); Toast.makeText(mActivity, result.message, Toast.LENGTH_SHORT).show(); ExceptionUtil.catchException(result.error, mActivity); } }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setType(Constants.JCFOOT); createView(SF, false); setLotNo(Constants.LOTNO_JCZ); setScoreBtn(); isTeamBtn(); MobclickAgent.onEvent(this, "jingcaizuqiu"); // BY贺思明 点击首页的“竞彩足球”图标 }
/** * 给作者发送邮件 反馈意见 * * @param context */ public static void gotoSendOpinion(Activity context) { MobclickAgent.onEvent(context, "send_email"); Intent localIntent = new Intent("android.intent.action.SENDTO", Uri.parse("mailto:[email protected]")); localIntent.putExtra( "android.intent.extra.SUBJECT", context.getString(R.string.title_email_opinion)); localIntent.putExtra("android.intent.extra.TEXT", Utils.getLog(context)); context.startActivity(localIntent); }
@Optional @OnClick(R.id.btn_change_to_portrait) public void changeToPortrait() { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); Map<String, String> extra = getChangeLayoutEventExtra(); MobclickAgent.onEvent(this.getActivity(), EventIDS.QUOTE_PORTRAIT_PV, extra); Tracker.getInstance(getActivity()) .addLog(new LogData.Builder(getActivity()).pv(EventIDS.QUOTE_PORTRAIT_PV).append(extra)); }
/** * 晒厨艺-发布 * * @param success * @param msg */ public static void onEventCookShowPublish(boolean success, String msg) { if (success) { MobclickAgent.onEvent(BaseApp.getApplication(), LogConstant.COOK_ACTION_PUBLISH); } Map<String, Object> keys = new HashMap<String, Object>(); keys.put(LOG_ZHUGE.EV_COOKSHOW_KEY_STATE, success); keys.put(LOG_ZHUGE.EV_COOKSHOW_KEY_MSG, msg); ZhugeSDK.getInstance() .onEvent(BaseApp.getApplication(), LOG_ZHUGE.EV_COOKSHOW_PUBLISH, new JSONObject(keys)); }
@Optional @OnClick(R.id.iv_to_landscape) public void changeToLandscape() { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); Map<String, String> extra = getChangeLayoutEventExtra(); MobclickAgent.onEvent(this.getActivity(), EventIDS.QUOTE_LANDSCAPE_PV, extra); Tracker.getInstance(getActivity()) .addLog(new LogData.Builder(getActivity()).pv(EventIDS.QUOTE_LANDSCAPE_PV).append(extra)); }