Java Code Examples for com.umeng.fb.FeedbackAgent#startFeedbackActivity()

The following examples show how to use com.umeng.fb.FeedbackAgent#startFeedbackActivity() . 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: 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;
	}
}
 
Example 5
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 6
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 7
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 8
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();
}