本文整理汇总了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;
}
}
});
}
示例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);
}
示例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);
}
示例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;
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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());
}
示例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;
}
示例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());
}