當前位置: 首頁>>代碼示例>>Java>>正文


Java UmengUpdateAgent.forceUpdate方法代碼示例

本文整理匯總了Java中com.umeng.update.UmengUpdateAgent.forceUpdate方法的典型用法代碼示例。如果您正苦於以下問題:Java UmengUpdateAgent.forceUpdate方法的具體用法?Java UmengUpdateAgent.forceUpdate怎麽用?Java UmengUpdateAgent.forceUpdate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.umeng.update.UmengUpdateAgent的用法示例。


在下文中一共展示了UmengUpdateAgent.forceUpdate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkUpdate

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
/**
 * 檢查更新
 */
@Click(R.id.rl_checkUpdate)
void checkUpdate() {
    UmengUpdateAgent.forceUpdate(getActivity());
    UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
        @Override
        public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
            switch (updateStatus) {
                case UpdateStatus.Yes: // has update
                    UmengUpdateAgent.showUpdateDialog(getActivity(), updateInfo);
                    break;
                case UpdateStatus.No: // has no update
                    ToastUtil.showToast(getActivity(), "當前已是最新版本");
                    break;
                case UpdateStatus.NoneWifi: // none wifi
                    // 注意:我已經在MainActivity中設置,更新時忽略隻在WIFE下更新,所以這個狀態暫時沒用
                    ToastUtil.showToast(getActivity(), "沒有wifi連接,隻在wifi下更新");
                    break;
                case UpdateStatus.Timeout: // time out
                    ToastUtil.showToast(getActivity(), "請求超時,請檢查網絡");
                    break;
            }
        }
    });

}
 
開發者ID:jpaijh,項目名稱:TYT,代碼行數:29,代碼來源:MineFragment.java

示例2: onPreferenceTreeClick

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
    String key = preference.getKey();
    String clearCache = getResources().getString(R.string.setting_key_clear_cache);
    String postback = getResources().getString(R.string.setting_key_post_back);
    String checkUpdate = getResources().getString(R.string.setting_key_check_update);

    if (key == clearCache){
        //clear cache
        biz.clearCache();
        Toast.makeText(getActivity(),getResources().getText(R.string.delete_success),Toast.LENGTH_LONG).show();
        return true;
    }else if (key == postback){
        FeedbackAgent agent = new FeedbackAgent(getActivity());
        agent.setWelcomeInfo(getActivity().getResources().getString(R.string.welcome_string));
        agent.startFeedbackActivity();
        return true;
    }else if (key == checkUpdate){
        UmengUpdateAgent.forceUpdate(getActivity());
        return true;
    }
    return super.onPreferenceTreeClick(preferenceScreen, preference);

}
 
開發者ID:nickalc,項目名稱:csdn-master,代碼行數:25,代碼來源:SettingFragment.java

示例3: checkUpdate

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
public static void checkUpdate(final Context context) {
    MyProgressDialog.show(context, null, context.getString(R.string.checkupdateing));
    UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
        @Override
        public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
            MyProgressDialog.DismissDialog();
            switch (updateStatus) {
                case UpdateStatus.Yes: // has update
                    UmengUpdateAgent.showUpdateDialog(context, updateInfo);
                    break;
                case UpdateStatus.No: // has no update
                    Toast.makeText(context, context.getString(R.string.noupdate), Toast.LENGTH_SHORT).show();
                    break;
                case UpdateStatus.NoneWifi: // none wifi
                    Toast.makeText(context, context.getString(R.string.onlyupdateinwifi), Toast.LENGTH_SHORT).show();
                    break;
                case UpdateStatus.Timeout: // time out
                    Toast.makeText(context, context.getString(R.string.timeout), Toast.LENGTH_SHORT).show();
                    break;
            }
        }
    });
    UmengUpdateAgent.forceUpdate(context);
}
 
開發者ID:SwiftyWang,項目名稱:FingerColoring-Android,代碼行數:25,代碼來源:UmengUtil.java

示例4: onClick

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.tv_setting_about_us:
            break;
        case R.id.tv_setting_your_idea:
            startActivity(new Intent(context, FeedbackActivity.class));
            if(getActivity() != null) {
                getActivity().overridePendingTransition(R.anim.right_in,R.anim.left_out);
            }
            break;
        case R.id.btn_logout:
            logout();
            break;
        case R.id.rl_setting_update_version:
            UmengUpdateAgent.forceUpdate(context);
            break;
    }
}
 
開發者ID:rantianhua,項目名稱:ShuTuier,代碼行數:20,代碼來源:SettingFragment.java

示例5: switchContent

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
public void switchContent(Fragment fragment, int position) {
	if (fragment != null) {
		mContent = fragment;	
		
		getSupportFragmentManager()
		.beginTransaction()
		.replace(R.id.content_frame, fragment)
		.commit();
	}
	getSlidingMenu().showContent();
	
	if (position == 3) {
	    UmengUpdateAgent.forceUpdate(this);
	}else if (position == 4) {
		FeedbackAgent agent = new FeedbackAgent(this);
		agent.sync();
		agent.startFeedbackActivity();
	}
}
 
開發者ID:quding0308,項目名稱:beautyClock,代碼行數:20,代碼來源:MainActivity.java

示例6: checkUpdate

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
private void checkUpdate() {
    Toast.makeText(mContext, "正在檢查。。。", Toast.LENGTH_SHORT).show();
    UmengUpdateAgent.setUpdateAutoPopup(false);
    UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
        @Override
        public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
            switch (updateStatus) {
                case UpdateStatus.Yes: // has update
                    Log.e(TAG, "有更新");
                    UmengUpdateAgent.showUpdateDialog(mContext, updateInfo);
                    break;
                case UpdateStatus.No: // has no update
                    Toast.makeText(mContext, "沒有更新", Toast.LENGTH_SHORT).show();
                    break;
                case UpdateStatus.NoneWifi: // none wifi
                    Toast.makeText(mContext, "沒有wifi連接, 隻在wifi下更新", Toast.LENGTH_SHORT).show();
                    break;
                case UpdateStatus.Timeout: // time out
                    Toast.makeText(mContext, "請檢查網絡", Toast.LENGTH_SHORT).show();
                    break;
            }
        }
    });
    UmengUpdateAgent.forceUpdate(mContext);
}
 
開發者ID:klob,項目名稱:Diandi1.20,代碼行數:26,代碼來源:SettingActivity.java

示例7: checkUpdate

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
public void checkUpdate() {
    UmengUpdateAgent.setUpdateAutoPopup(false);
    UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
        @Override
        public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
            switch (updateStatus) {
                case UpdateStatus.Yes: // has update
                    editor.putBoolean(SHARED_KEY_UPDATE, true);
                    editor.commit();
                    break;
                case UpdateStatus.No:
                    editor.putBoolean(SHARED_KEY_UPDATE, false);
                    editor.commit();
                    break;
            }
        }
    });
    UmengUpdateAgent.forceUpdate(mContext);


}
 
開發者ID:klob,項目名稱:Diandi1.20,代碼行數:22,代碼來源:SharePreferenceUtil.java

示例8: update

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
private void update() {
    UmengUpdateAgent.setUpdateAutoPopup(false);
    UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {

        @Override
        public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
            switch (updateStatus) {
            case 0: // has update
                UmengUpdateAgent.showUpdateDialog(SettingsActivity.this, updateInfo);
                break;
            case 1: // has no update
                Toast.makeText(SettingsActivity.this, "已是最新版", Toast.LENGTH_SHORT).show();
                break;
            case 2: // none wifi
                Toast.makeText(SettingsActivity.this, "沒有wifi連接, 隻在wifi下更新", Toast.LENGTH_SHORT)
                        .show();
                break;
            case 3: // time out
                Toast.makeText(SettingsActivity.this, "超時", Toast.LENGTH_SHORT).show();
                break;
            }
        }

    });
    UmengUpdateAgent.forceUpdate(this);
}
 
開發者ID:yrom,項目名稱:AcFun-Area63,代碼行數:27,代碼來源:SettingsActivity.java

示例9: forceUpdate

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
/**
 * 強製更新
 * 
 * @param context
 * @param listener
 */
public static void forceUpdate(Context context, UmengUpdateListener listener)
{
	// 檢查更新
	UmengUpdateAgent.forceUpdate(context);
	UmengUpdateAgent.setUpdateListener(listener);
}
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:13,代碼來源:UmengUpdateAgentProxy.java

示例10: onClick

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
@Override
public void onClick(View v) {

    switch (v.getId()) {
        case R.id.llApp:
            openAppMarket();
            break;
        case R.id.llRectangle:
            rectangle();
            break;
        case R.id.llClean:
            clean();
            break;
        case R.id.llAbout:
            about();
            break;

        case R.id.llLoginDiv:
            showLoginActivity();
            break;
        case R.id.llUpdate:

            UmengUpdateAgent.forceUpdate(SettingActivity.this);
            break;
        case R.id.llLoginOut:
            loginOut();
            break;
    }
}
 
開發者ID:joy-inc,項目名稱:joy-app,代碼行數:30,代碼來源:SettingActivity.java

示例11: onPreferenceClick

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
@Override
    public boolean onPreferenceClick(android.preference.Preference preference) {
        String key = preference.getKey();
        //用if判斷 效率不會很好 待改善
        if(key.equals(getString(R.string.preference_key_about))){
            String htmlFileName =  Utils.isChineseLanguage()?"about_ch.html":"about.html";
            DialogUtil.showCustomDialogFillInWebView(mContext, mContext.getSupportFragmentManager(), getString(R.string.preference_title_about), htmlFileName, "about");
            MobclickAgent.onEvent(mContext, "setting_about");
        }
        if(key.equals(getString(R.string.preference_key_score))){
//            NavigationManager.gotoMarket(mContext,getActivity().getPackageName());
            AppRate.with(getActivity()).showRateDialog(getActivity());
            MobclickAgent.onEvent(mContext, "setting_market");
        }
        if(key.equals(getString(R.string.preference_key_opinion))){
            NavigationManager.gotoSendOpinion(getActivity());
            MobclickAgent.onEvent(getActivity(), "send_email");
        }
        if(key.equals(getString(R.string.preference_key_check_update))){
            UmengUpdateAgent.setUpdateListener(new CheckUmengUpdateListener());
            UmengUpdateAgent.forceUpdate(mContext);
            MobclickAgent.onEvent(mContext, "setting_check_update");
        }
        if(key.equals(getString(R.string.preference_key_license))){
            DialogUtil.showCustomDialogFillInWebView(mContext, mContext.getSupportFragmentManager(), getString(R.string.preference_title_license), "license.html", "license");
            MobclickAgent.onEvent(mContext, "setting_license");
        }
        return false;
    }
 
開發者ID:maoruibin,項目名稱:AppPlus,代碼行數:30,代碼來源:AboutFragment.java

示例12: onClick

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
@Override
public void onClick(View v) {
	// TODO Auto-generated method stub
	super.onClick(v);
	if (isClickable)
		return;
	isClickable = true;
	switch (v.getId()) {
	case R.id.more_topic:
		startToActivity(ThemeActivity.class);
		break;
	case R.id.more_timeUpdate:
		startToActivity(UpdateSettingActivity.class);
		break;
	case R.id.more_unlock:
		initMogoWall();
		isClickable = false;
		// startToActivity(WallActivity.class);
		break;
	case R.id.more_statistics:
		startToActivity(ReadstatisticsActivity.class);
		break;
	case R.id.more_passwordProtect:
		startToActivity(PasswordLockActivity.class);
		break;
	case R.id.more_feedback:
		startToActivity(FeedBackActivity.class);
		break;
	case R.id.more_update:
		showRefreshDialog("檢查版本更新中");
		UmengUpdateAgent.forceUpdate(getActivity());
		UmengUpdateAgent.setUpdateListener(this);
		break;
	default:
		break;
	}

}
 
開發者ID:justingboy,項目名稱:CouldBooks,代碼行數:39,代碼來源:MoreFragment.java

示例13: initView

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
public void initView(View rootView) {
        mSwipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(R.id.swipe_container);
        mSwipeRefreshLayout.setColorScheme(R.color.main_red_color);
        mSwipeRefreshLayout.setOnRefreshListener(this);
        mSwipeRefreshLayout.setProgressViewOffset(true, 0, UIUtils.dip2px(getActivity(), 48));
        mListView = (ListView) rootView.findViewById(R.id.listview);

        LocalBroadcastManager.getInstance(getActivity())
                .registerReceiver(refreshDevicesReceiver,
                        new IntentFilter(ActionConstants.ACTON_REFRESH_DEVICES));
        refreshDevices(true);
//		UpdateConfig.setDebug(true);
        UmengUpdateAgent.forceUpdate(getActivity());
    }
 
開發者ID:free-iot,項目名稱:freeiot-android,代碼行數:15,代碼來源:MyDevicesListFragment.java

示例14: onPreferenceClick

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
@Override
public boolean onPreferenceClick(Preference preference) {
    if (preference.getKey().equals("update")) {
        UmengUpdateAgent.setUpdateAutoPopup(false);
        UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
            @Override
            public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
                switch (updateStatus) {
                    case UpdateStatus.Yes: // has update
                        UmengUpdateAgent.showUpdateDialog(SettingsActivity.this, updateInfo);
                        break;
                    case UpdateStatus.No: // has no update
                        Toast.makeText(SettingsActivity.this, "你的應用是最新版本", Toast.LENGTH_SHORT).show();
                        break;
                    case UpdateStatus.NoneWifi: // none wifi
                        Toast.makeText(SettingsActivity.this, "沒有wifi連接, 隻在wifi下更新", Toast.LENGTH_SHORT).show();
                        break;
                    case UpdateStatus.Timeout: // time out
                        Toast.makeText(SettingsActivity.this, "超時", Toast.LENGTH_SHORT).show();
                        break;
                }
            }
        });
        UmengUpdateAgent.forceUpdate(this);

    }
    return true;
}
 
開發者ID:yimun,項目名稱:DLUTLogin,代碼行數:29,代碼來源:SettingsActivity.java

示例15: btn_update

import com.umeng.update.UmengUpdateAgent; //導入方法依賴的package包/類
@Click
void btn_update(){
    AppMsg.makeText(getSherlockActivity(),
            app.getString(R.string.tips_checking_for_update)
            , AppMsg.STYLE_INFO).show();
    UmengUpdateAgent.setUpdateAutoPopup(false);
    UmengUpdateAgent.setUpdateListener(umengUpdateListener);
    UmengUpdateAgent.forceUpdate(getSherlockActivity());
}
 
開發者ID:iSCAU,項目名稱:iSCAU-Android,代碼行數:10,代碼來源:Configuration.java


注:本文中的com.umeng.update.UmengUpdateAgent.forceUpdate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。