com.umeng.fb.FeedbackAgent Java Examples

The following examples show how to use com.umeng.fb.FeedbackAgent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From Akoi-Translator with MIT License 6 votes vote down vote up
@Override
public boolean onPreferenceClick(Preference preference) {
	String clickedKey = preference.getKey();
	MobclickAgent.onEvent(this, clickedKey);
	AppLog.i(LOGTAG, "onPreferenceClick clickedKey=" + clickedKey);
	if (getString(R.string.pref_key_feedback).equals(clickedKey)) {
		FeedbackAgent agent = new FeedbackAgent(this);
		agent.startFeedbackActivity();
	} else if (getString(R.string.pref_key_recommend).equals(clickedKey)) {
		YoumiAdProxy.getInstance().showVideoAd(this);
	} else if (getString(R.string.pref_key_about).equals(clickedKey)) {
		showDialog(0);
	} else if (getString(R.string.pref_key_donate).equals(clickedKey)) {
		Intent intent = new Intent(Intent.ACTION_VIEW);
		intent.setData(Uri.parse("http://droidyue.com/donate/"));
		startActivity(intent);
	}
	return false;
}
 
Example #2
Source File: SettingsActivity.java    From Jide-Note with MIT License 6 votes vote down vote up
@Override
public void onClick(View v) {

    switch (v.getId()){
        case R.id.settings_about_tv:
            startActivity(new Intent(SettingsActivity.this, AboutActivity.class));
            break;
        case R.id.settings_score_tv:
            SysUtils sysUtils = SysUtils.getInstance(SettingsActivity.this.getApplicationContext());
            sysUtils.goMarket();
            break;
        case R.id.settings_introduce_tv:
            startActivity(new Intent(SettingsActivity.this, IntroduceActivity.class));
            break;
        case R.id.settings_feedback_tv:
            agent = new FeedbackAgent(SettingsActivity.this);
            agent.startFeedbackActivity();
            break;
        default:
            break;
    }
}
 
Example #3
Source File: MainActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
	// Handle action bar item clicks here. The action bar will
	// automatically handle clicks on the Home/Up button, so long
	// as you specify a parent activity in AndroidManifest.xml.
	int id = item.getItemId();
	// �û�������ť
	if (id == R.id.feedback) {
		FeedbackAgent agent = new FeedbackAgent(MainActivity.this);
		agent.startFeedbackActivity();
	}
	if (id == R.id.logout) {
		sharedPreferences.clear();
		PersistentCookieStore cookieStore = new PersistentCookieStore(
				MainActivity.this);
		cookieStore.clear();
		Intent intent = new Intent(this, MainActivity.class);
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(intent);
		return true;
	}
	return super.onOptionsItemSelected(item);
}
 
Example #4
Source File: MainActivity.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
private void init() {
	MainActivityActionbar = getSupportActionBar();
	mFragmentManager = getSupportFragmentManager();
	setDrawer();
	initWeekTitle();
	agent = new FeedbackAgent(this);
	agent.sync();
	// MobclickAgent.setDebugMode(true);
	MobclickAgent.openActivityDurationTrack(false);
	UmengUpdateAgent.setUpdateOnlyWifi(false);
	UmengUpdateAgent.update(this);
}
 
Example #5
Source File: ActivitySetting.java    From wakao-app with MIT License 5 votes vote down vote up
private void initView() {
	TextView tView = (TextView) findViewById(R.id.top_bar_title);
	ImageButton iButton = (ImageButton) findViewById(R.id.m_toggle);
	checkUpdate = (TextView) findViewById(R.id.checkUpdate);
	agent = new FeedbackAgent(this);
	agent.sync();

	ac_desc = (TextView) findViewById(R.id.account_settings_desc);
	ac = (TextView) findViewById(R.id.account_name);
	cacheSize = (TextView) findViewById(R.id.cache_size);
	logout = (TextView) findViewById(R.id.logout);

	tView.setText("设置");
	iButton.setVisibility(View.GONE);
	cacheSize.setText(AppTool.getCacheSize(this));
	
	checkUpdate.setOnClickListener(new View.OnClickListener() {
		public void onClick(View v) {
			// 如果想程序启动时自动检查是否需要更新, 把下面两行代码加在Activity 的onCreate()函数里。
			com.umeng.common.Log.LOG = true;
			
			UmengUpdateAgent.setUpdateOnlyWifi(false); // 目前我们默认在Wi-Fi接入情况下才进行自动提醒。如需要在其他网络环境下进行更新自动提醒,则请添加该行代码
			UmengUpdateAgent.setUpdateAutoPopup(false);
			UmengUpdateAgent.setUpdateListener(new MyUpdateListener(mContext));
			UmengUpdateAgent.setDownloadListener(new UpdateDownloadListener(mContext));
			UmengUpdateAgent.forceUpdate(mContext);
		}
	});
}
 
Example #6
Source File: Main.java    From iSCAU-Android with GNU General Public License v3.0 5 votes vote down vote up
private void initMobclickAgent(){
    MobclickAgent.updateOnlineConfig(this);
    MobclickAgent.openActivityDurationTrack(false);
    // 检查反馈消息;
    FeedbackAgent agent = new FeedbackAgent(this);
    agent.sync();
}
 
Example #7
Source File: HomeActivity.java    From SimplifyReader with Apache License 2.0 5 votes vote down vote up
@Override
protected void initViewsAndEvents() {
    mFeedbackAgent = new FeedbackAgent(this);
    mFeedbackAgent.sync();
    mFeedbackAgent.closeFeedbackPush();
    mFeedbackAgent.closeAudioFeedback();
    mFeedbackAgent.setWelcomeInfo(getResources().getString(R.string.feedback_welcome_info));

    mHomePresenter = new HomePresenterImpl(this, this);
    mHomePresenter.initialized();
}
 
Example #8
Source File: WelcomeAty.java    From Huochexing12306 with Apache License 2.0 5 votes vote down vote up
public void operateUmeng() {
	UmengUpdateAgent.setUpdateUIStyle(UpdateStatus.STYLE_NOTIFICATION);
	UmengUpdateAgent.setDeltaUpdate(true);
	UmengUpdateAgent.setUpdateOnlyWifi(false);
	UmengUpdateAgent.update(this);
	//检测开发者反馈回复
	FeedbackAgent agent = new FeedbackAgent(this);
	agent.sync();
}
 
Example #9
Source File: MainActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	sharedPreferences = new FanfanSharedPreferences(MainActivity.this);
	ActionBar actionBar = getActionBar();
	actionBar.setDisplayShowHomeEnabled(false);
	if (!sharedPreferences.getLogInStatus(false)) {
		draweritems = this.getResources().getStringArray(
				R.array.nologindrawerliststring);
	} else {
		draweritems = this.getResources().getStringArray(
				R.array.drawerliststring);
		// Login();
	}
	mNavigationDrawerFragment = (NavigationDrawerFragment) getFragmentManager()
			.findFragmentById(R.id.navigation_drawer);
	mTitle = getTitle();

	// Set up the drawer.
	mNavigationDrawerFragment.setUp(R.id.navigation_drawer,
			(DrawerLayout) findViewById(R.id.drawer_layout));
	// ���������Զ��������
	UmengUpdateAgent.update(MainActivity.this);
	// �û���������̨����Ƿ����µ����Կ����ߵĻظ���
	FeedbackAgent mAgent = new FeedbackAgent(MainActivity.this);
	mAgent.sync();
	MobclickAgent.updateOnlineConfig(MainActivity.this);
}
 
Example #10
Source File: CustomActivity.java    From quickmark with MIT License 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	requestWindowFeature(Window.FEATURE_NO_TITLE);
	setContentView(R.layout.activity_custom);

	SysApplication.getInstance().addActivity(this); // �����ٶ��������this

	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
		setTranslucentStatus(true);
		findViewById(R.id.fb_top).setVisibility(View.VISIBLE);
	}
	SystemBarTintManager mTintManager = new SystemBarTintManager(this);
	mTintManager.setStatusBarTintEnabled(true);
	mTintManager.setStatusBarTintResource(R.color.statusbar_bg);

	mContext = this;
	SharedPreferences sp = this.getSharedPreferences("preferences",
			MODE_WORLD_READABLE);
	Editor edit = sp.edit();

	initView();

	Intent intentr = getIntent();
	Bundle bundle = intentr.getExtras();// ��ȡ��������ݣ���ʹ��Bundle��¼
	if (bundle != null) {
		if (bundle.containsKey("cwp.md")) {
			String error = (String) bundle.getString("cwp.md");// ��ȡBundle�м�¼����Ϣ
			inputEdit.setText(error);
		}
	}
	mAgent = new FeedbackAgent(this);
	mComversation = new FeedbackAgent(this).getDefaultConversation();
	if (!firstfb.equals(sp.getString("firstfb", ""))) {
		mComversation.addUserReply("���ã���ӭʹ�ÿ��ټǣ��뷴��ʹ�ò�Ʒ�ĸ��ܺͽ���");
		edit.putString("firstfb", "true"); // һ��ֻ���һ��
		edit.commit();
	}
	adapter = new ReplyAdapter();
	mListView.setAdapter(adapter);
	sync();

}
 
Example #11
Source File: About.java    From iSCAU-Android with GNU General Public License v3.0 4 votes vote down vote up
@Click
void btn_advise(){
    FeedbackAgent agent = new FeedbackAgent(this);
    agent.startFeedbackActivity();
}
 
Example #12
Source File: AvsActivity.java    From AVS with Apache License 2.0 4 votes vote down vote up
@Override
public void onClick(View v) {
	int id = v.getId();
	switch (id) {
	case R.id.cid:
	case R.id.pwd:
		showModifyInfoDialog();
		break;
	case R.id.menu:
		if(menu_layout.getVisibility() == View.VISIBLE){
			menu_layout.setVisibility(View.GONE);
		}else{
		menu_layout.setVisibility(View.VISIBLE);
		}
		break;
	case R.id.help:
		menu_layout.setVisibility(View.GONE);
		Intent intent = new Intent();
		intent.setClass(getApplicationContext(), GuideActivity.class);
		intent.putExtra(GuideActivity.START_AVS_ACTIVITY, false);
		startActivity(intent);
		break;
	case R.id.feedback:
		menu_layout.setVisibility(View.GONE);
		FeedbackAgent agent = new FeedbackAgent(this);
		agent.startFeedbackActivity();
		break;
	case R.id.about:
		menu_layout.setVisibility(View.GONE);
		showAboutDialog();
		break;
	case R.id.disclaimer:
		menu_layout.setVisibility(View.GONE);
		showDisclaimerDlg();
		break;
	case R.id.avs_title:
	case R.id.main_layout:
		if(menu_layout.getVisibility() == View.VISIBLE){
			menu_layout.setVisibility(View.GONE);
		}
		break;
	default:
		break;
	}
}
 
Example #13
Source File: MainActivity.java    From ONE-Unofficial with Apache License 2.0 4 votes vote down vote up
private void setUmeng() {
        //对友盟统计日志加密
        AnalyticsConfig.enableEncrypt(true);
        //友盟统计不采集mac信息
        MobclickAgent.setCheckDevice(false);

        //禁止自动提示更新对话框
        UmengUpdateAgent.setUpdateAutoPopup(false);
        //禁止增量更新
        UmengUpdateAgent.setDeltaUpdate(false);
        UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
            @Override
            public void onUpdateReturned(int status, UpdateResponse updateResponse) {
                switch (status) {
                    case UpdateStatus.Yes:
                        //有更新
                        showUpdateDialog(updateResponse);
                        break;
                    case UpdateStatus.No:
                        //无更新
                        break;
                    case UpdateStatus.NoneWifi:
                        //无wifi
                        break;
                    case UpdateStatus.Timeout:
                        //超时
                        break;
                }
            }
        });
        //友盟设置检查更新,不限于wifi
        UmengUpdateAgent.setUpdateOnlyWifi(false);
        //禁用集成检测,否则会提示缺少xxx,然而我并不需要那些东西
        UmengUpdateAgent.setUpdateCheckConfig(false);
        //检查更新
        UmengUpdateAgent.update(this);

        //同步数据
        final FeedbackAgent agent = new FeedbackAgent(this);
//        agent.openFeedbackPush();      启用推送在小米手机上会有崩溃发生
        agent.sync();
        UserInfo userInfo = agent.getUserInfo();
        String nickname = ConfigUtil.readString("user", "nickname");
        if (TextUtils.isEmpty(nickname)) {
            final String n = generateNickname();
            Map<String, String> contact = new HashMap<>();
            contact.put("昵称", n);
            userInfo.setContact(contact);
            agent.setUserInfo(userInfo);
            new Thread(new Runnable() {
                @Override
                public void run() {
                    boolean success = agent.updateUserInfo();
                    if (success) {
                        ConfigUtil.writeString("user", "nickname", n);
                    }
                }
            }).start();

        }
        //启用推送
//        PushAgent.getInstance(this).enable();  启用推送在小米手机上会有崩溃发生
    }
 
Example #14
Source File: SettingsFragment.java    From phphub-android with Apache License 2.0 4 votes vote down vote up
@Override
public boolean onPreferenceClick(Preference preference) {
    switch (preference.getKey()) {
        case "feedback":
            final FeedbackAgent agent = new FeedbackAgent(getActivity());
            agent.startFeedbackActivity();

            com.umeng.fb.model.UserInfo info = agent.getUserInfo();
            if (info == null) {
                info = new UserInfo();
            }

            Map<String, String> contact = info.getContact();
            if (contact == null) {
                contact = new HashMap<>();
            }

            if (Utils.hasLoggedIn(getActivity(), accountManager)) {
                contact.put("plain", "uid: "+ accountManager.getUserData(account, USER_ID_KEY) + " uname: "+accountManager.getUserData(account, USERNAME_KEY));

                info.setContact(contact);

                agent.setUserInfo(info);

                new Thread(new Runnable() {
                    @Override
                    public void run() {
                        boolean result = agent.updateUserInfo();
                    }
                }).start();
            }
            return true;
        case "source_code":
            Intent intentCode = WebViewPageActivity.getCallingIntent(getActivity(), "https://github.com/phphub/phphub-android");
            getActivity().startActivity(intentCode);

            return true;
        case "about_phphub":
            Intent intentPhphub = WebViewPageActivity.getCallingIntent(getActivity(), "https://phphub.org/about");
            getActivity().startActivity(intentPhphub);

            return true;
        case "about_our_group":
            Intent intentGroup = WebViewPageActivity.getCallingIntent(getActivity(), "http://est-group.org");
            getActivity().startActivity(intentGroup);

            return true;
        case LOGOUT_KEY:
            new AlertDialog.Builder(getActivity())
                    .setMessage("确认退出吗?")
                    .setCancelable(false
                    )
                    .setPositiveButton("退出", new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            JPushInterface.setAlias(getActivity().getApplicationContext(), "", null);
                            accountManager.removeAccount(Utils.getAccounts(getActivity(), accountManager)[0], null, null);
                            getPreferenceScreen().removePreference(findPreference(LOGOUT_KEY));
                        }
                    })
                    .setNegativeButton("容我想想", null)
                    .show();
            return true;
    }
    return false;
}
 
Example #15
Source File: AboutActivity.java    From android-project-wo2b with Apache License 2.0 4 votes vote down vote up
@Override
protected void setDefaultValues()
{
	mFeedbackAgent = new FeedbackAgent(this);
	mFeedbackAgent.sync();
}
 
Example #16
Source File: AvsActivity.java    From AVS with Apache License 2.0 4 votes vote down vote up
@Override
public void onClick(View v) {
	int id = v.getId();
	switch (id) {
	case R.id.cid:
	case R.id.pwd:
		showModifyInfoDialog();
		break;
	case R.id.menu:
		if(menu_layout.getVisibility() == View.VISIBLE){
			menu_layout.setVisibility(View.GONE);
		}else{
		menu_layout.setVisibility(View.VISIBLE);
		}
		break;
	case R.id.help:
		menu_layout.setVisibility(View.GONE);
		Intent intent = new Intent();
		intent.setClass(getApplicationContext(), GuideActivity.class);
		intent.putExtra(GuideActivity.START_AVS_ACTIVITY, false);
		startActivity(intent);
		break;
	case R.id.feedback:
		menu_layout.setVisibility(View.GONE);
		FeedbackAgent agent = new FeedbackAgent(this);
		agent.startFeedbackActivity();
		break;
	case R.id.about:
		menu_layout.setVisibility(View.GONE);
		showAboutDialog();
		break;
	case R.id.disclaimer:
		menu_layout.setVisibility(View.GONE);
		showDisclaimerDlg();
		break;
	case R.id.avs_title:
	case R.id.main_layout:
		if(menu_layout.getVisibility() == View.VISIBLE){
			menu_layout.setVisibility(View.GONE);
		}
		break;
	default:
		break;
	}
}
 
Example #17
Source File: CameraListActivity.java    From Viewer with Apache License 2.0 4 votes vote down vote up
@Override
public void onClick(View v) {
	int id = v.getId();
	switch(id){
	case R.id.help:
		Intent guideIntent = new Intent();
		guideIntent.setClass(getApplicationContext(), GuideActivity.class);
		guideIntent.putExtra(GuideActivity.START_AVS_ACTIVITY, false);
		startActivity(guideIntent);
		break;
	case R.id.feedback:
		FeedbackAgent agent = new FeedbackAgent(this);
		agent.startFeedbackActivity();
		break;
	case R.id.about:
		showAboutDialog();
		break;
	case R.id.disclaimer:
		showDisclaimerDlg();
		break;
	case R.id.business:
		try{
			Intent data=new Intent(Intent.ACTION_SENDTO); 
			data.setData(Uri.parse("mailto:[email protected]"));
			startActivity(data);
		}catch (Exception e) {
			Toast.makeText(getApplicationContext(), R.string.mail_to, Toast.LENGTH_LONG).show();
		}
		break;
	case R.id.logout:
		mUserInfo.setLoginInfo(false, "", "", "");
		Intent intent = new Intent();
		intent.setClass(getApplicationContext(), LoginActivity.class);
		startActivity(intent);
		isExitWithLogout = true;
		mMyViewerHelper.removeAllCameraInfos();
		mCameraInfoManager.deleteAll();
		finish();
		break;
	case R.id.back_linlayout:
		if(!mUserLayout.isDrawerOpen(Gravity.LEFT))
			mUserLayout.openDrawer(Gravity.LEFT);
		break;
	case R.id.opt_linlayout:
		openAddDialog();
		break;
	case R.id.add_cid:
		if(mShowAddLayoutDialog != null){
			mShowAddLayoutDialog.dismiss();
			titlebar_opt_image.setBackgroundResource(R.drawable.add_icon);
		}
		showAddCameraDlg();
		break;
	case R.id.add_cid_by_qr:
		if(mShowAddLayoutDialog != null){
			mShowAddLayoutDialog.dismiss();
			titlebar_opt_image.setBackgroundResource(R.drawable.add_icon);
		}
		Intent intent1 = new Intent();
		intent1.setClass(this, CaptureActivity.class);
		intent1.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivityForResult(intent1, SCANNIN_GREQUEST_CODE);
		break;
		default:
			break;
	}
}