本文整理汇总了Java中com.umeng.update.UmengUpdateAgent类的典型用法代码示例。如果您正苦于以下问题:Java UmengUpdateAgent类的具体用法?Java UmengUpdateAgent怎么用?Java UmengUpdateAgent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UmengUpdateAgent类属于com.umeng.update包,在下文中一共展示了UmengUpdateAgent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getListView().setOnRefreshListener(this);
getListView().setOnItemClickListener(mOnItemClickListener);
mImgState.setOnClickListener(mOnImgStateClick);
mBtnFavorite.setOnClickListener(mOnBtnFavoriteClick);
mBtnSetting.setOnClickListener(mOnBtnSettingClick);
//加载数据,先读缓存
//App.showLoadingOrNoNet(true, true, false, mImgState);
boolean loaded = loadFromCache(1);
//强制刷新发布数量数据
if (loaded ? Network.isNetConnected(this) : App.checkNetStateAndFeedbackUser()) loadData(true, 1);
// 友盟的在线自动更新
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
}
示例2: 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;
}
}
});
}
示例3: 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
UmengUpdateAgent.showUpdateDialog(MainActivity.this, updateInfo);
break;
case UpdateStatus.No: // has no update
showMsg("当前已是最新版本"+SF.TIP);
break;
case UpdateStatus.Timeout: // time out
showMsg("检测超时"+SF.FAIL);
break;
}
UmengUpdateAgent.setUpdateAutoPopup(true);
UmengUpdateAgent.setUpdateListener(null);
}
});
showMsg("检测更新中,请稍候...");
UmengUpdateAgent.update(this);
}
示例4: 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);
}
示例5: 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);
}
示例6: onCreate
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
/*requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);*/
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
//判斷是否是新用戶
if(PrefUtils.getBoolean(this,ConsUtils.IS_FIRST_TIME,true)){
startActivity(new Intent(this,GuideActivity.class));
finish();
return;
}
UmengUpdateAgent.update(this);
//初始化数据库
initDataBase("china_Province_city_zone.db");
initSlideMenu();
initView();
initFragment();
initService();
Intent intent=getIntent();
if(intent.getBooleanExtra("showGuide", false)){
firstTimeGuide();
}
}
示例7: initViews
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
/**
* Initialize the view in the layout
*
* @param savedInstanceState savedInstanceState
*/
@Override protected void initViews(Bundle savedInstanceState) {
this.dataDecoration = new EasyBorderDividerItemDecoration(
this.getResources().getDimensionPixelOffset(R.dimen.data_border_divider_height),
this.getResources()
.getDimensionPixelOffset(R.dimen.data_border_padding_infra_spans));
this.welfareDecoration = new EasyBorderDividerItemDecoration(
this.getResources().getDimensionPixelOffset(R.dimen.welfare_border_divider_height),
this.getResources()
.getDimensionPixelOffset(R.dimen.welfare_border_padding_infra_spans));
this.mainRv.addItemDecoration(this.dataDecoration);
this.mLinearLayoutManager = (LinearLayoutManager) this.mainRv.getLayoutManager();
this.mStaggeredGridLayoutManager = new StaggeredGridLayoutManager(2,
StaggeredGridLayoutManager.VERTICAL);
this.mActionBarHelper.setDrawerTitle(this.getResources().getString(R.string.app_menu));
UmengUpdateAgent.update(this);
}
示例8: checkNewVersionAvailable
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
public static void checkNewVersionAvailable(Context context, final OnUpdateCheckComplete onUpdateCheckComplete){
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
@Override
public void onUpdateReturned(int updateStatus,UpdateResponse updateInfo) {
switch (updateStatus) {
case UpdateStatus.Yes: // has update
// UmengUpdateAgent.showUpdateDialog(MainListActivity.this, updateInfo);
// App.setIfNeedUpdate(true);
onUpdateCheckComplete.hasNewVersion(updateInfo);
break;
case UpdateStatus.No: // has no update
onUpdateCheckComplete.hasNoNewVersion();
break;
case UpdateStatus.NoneWifi: // none wifi
onUpdateCheckComplete.hasNoNewVersion();
break;
case UpdateStatus.Timeout: // time out
onUpdateCheckComplete.hasNoNewVersion();
break;
}
}
});
UmengUpdateAgent.update(context);
}
示例9: checkNewVersionAvailableAndNotify
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
public static void checkNewVersionAvailableAndNotify(final Context context){
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
@Override
public void onUpdateReturned(int updateStatus,UpdateResponse updateInfo) {
switch (updateStatus) {
case UpdateStatus.Yes: // has update
UmengUpdateAgent.showUpdateDialog(context, updateInfo);
break;
case UpdateStatus.No: // has no update
break;
case UpdateStatus.NoneWifi: // none wifi
break;
case UpdateStatus.Timeout: // time out
break;
}
}
});
UmengUpdateAgent.update(context);
}
示例10: onCreate
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
fmTrackList = new AllTrackListFragment();
setFragement(fmTrackList);
getSupportActionBar().setDisplayShowHomeEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setIcon(R.drawable.ic_drawer);
if(!EventBus.getDefault().isRegistered(this)){
EventBus.getDefault().register(this);
}
//检测更新
UmengUpdateAgent.update(this);
}
示例11: onCreate
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@SuppressWarnings("ConstantConditions")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
UmengUpdateAgent.update(this);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setupDrawerContent(navigationView);
setupViewPager(viewPager);
viewPager.setCurrentItem(getIntent().getIntExtra(EXTRA_FRAG_TYPE, DEFAULT_FRAG));
tabLayout.setupWithViewPager(viewPager);
// startService(new Intent(this, PrefetchService.class));
}
示例12: onCreate
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if ("baidu".equalsIgnoreCase(BuildConfig.AUTO_TYPE)) {
BDAutoUpdateSDK.silenceUpdateAction(this);//百度静默更新
Log.e(TAG, "baidu更新");
} else if ("360".equalsIgnoreCase(BuildConfig.AUTO_TYPE)) {
UpdateManager.setTestMode(2);//测试模式 1有更新 2有更新并省流量
UpdateManager.setDebug(true);//打印日志
UpdateManager.checkUpdate(this);
Log.e(TAG, "360更新");
} else if ("xiaomi".equalsIgnoreCase(BuildConfig.AUTO_TYPE)) {
XiaomiUpdateAgent.update(this);
Log.e(TAG, "小米更新");
} else if ("umeng".equalsIgnoreCase(BuildConfig.AUTO_TYPE)) {
UmengUpdateAgent.update(this);
Log.e(TAG, "umeng更新");
} else {
}
}
示例13: onCreate
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ViewUtils.inject(this);
init();
initCheckBoxStatusAndSetListenner();
UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
@Override
public void onUpdateReturned(int updateStatus,UpdateResponse updateInfo) {
switch (updateStatus) {
case UpdateStatus.Yes: // has update
UmengUpdateAgent.showUpdateDialog(UserCenterActivity.this, updateInfo);
break;
case UpdateStatus.No: // has no update
ToastUtils.showMessageInCenter(UserCenterActivity.this, "已是最新版本");
break;
case UpdateStatus.Timeout: // time out
ToastUtils.showMessageInCenter(UserCenterActivity.this, "检测超时");
break;
}
}
});
}
示例14: onUpdateReturned
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@Override
public void onUpdateReturned(int updateStatus, UpdateResponse updateInfo) {
switch (updateStatus) {
case UpdateStatus.Yes: // has update
UmengUpdateAgent.showUpdateDialog(mContext, updateInfo);
break;
case UpdateStatus.No: // has no update
DialogUtil.showSinglePointDialog(mContext,mContext.getString(R.string.update_point_no_update));
break;
case UpdateStatus.NoneWifi: // none wifi
DialogUtil.showSinglePointDialog(mContext, mContext.getString(R.string.update_point_no_wifi));
break;
case UpdateStatus.Timeout: // time out
DialogUtil.showSinglePointDialog(mContext, mContext.getString(R.string.update_point_time_out));
break;
}
}
示例15: onCreate
import com.umeng.update.UmengUpdateAgent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
initData();
}
// 接受消息推送 广播 数据 处理相应逻辑
if (BROAD_RECEIVER_ACTION.equals(getIntent().getAction())) {
Bundle bundle = getIntent().getBundleExtra(PushBroadcastReceiver.BROAD_DATA_KEY);
String title = bundle.getString("title");
Log.i(BROAD_RECEIVER_ACTION, title);
}
// 第三方SDK初始化
AVInstallation.getCurrentInstallation().saveInBackground();
PushService.setDefaultPushCallback(this, MainActivity_.class);
FeedbackAgent agent = new FeedbackAgent(this);
agent.sync();
UmengUpdateAgent.update(this);
BmobPay.init(this, Constants.BMOB_APPLICATION_ID);
}