本文整理汇总了Java中com.umeng.update.UmengUpdateAgent.setUpdateOnlyWifi方法的典型用法代码示例。如果您正苦于以下问题:Java UmengUpdateAgent.setUpdateOnlyWifi方法的具体用法?Java UmengUpdateAgent.setUpdateOnlyWifi怎么用?Java UmengUpdateAgent.setUpdateOnlyWifi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.umeng.update.UmengUpdateAgent
的用法示例。
在下文中一共展示了UmengUpdateAgent.setUpdateOnlyWifi方法的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: 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);
}
示例3: 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);
}
示例4: operateUmeng
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
public void operateUmeng() {
UmengUpdateAgent.setUpdateUIStyle(UpdateStatus.STYLE_NOTIFICATION);
UmengUpdateAgent.setDeltaUpdate(true);
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
//检测开发者反馈回复
FeedbackAgent agent = new FeedbackAgent(this);
agent.sync();
}
示例5: checkAutoUpdateByUmeng
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
public void checkAutoUpdateByUmeng() {
if(mContext.getIntent().getSerializableExtra("BUNDLE_GANK") == null){
UmengUpdateAgent.setUpdateCheckConfig(BuildConfig.DEBUG);
//check update even in 2g/3g/4g condition
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(mContext);
}
}
示例6: autoUpdate
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
public static void autoUpdate(final Context context) {
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(context);
UmengUpdateAgent.setUpdateListener(new UmengUpdateListener() {
@Override
public void onUpdateReturned(int i, UpdateResponse updateResponse) {
if (updateResponse != null && updateResponse.updateLog != null && !updateResponse.updateLog.isEmpty()) {
SharedPreferencesFactory.saveString(context, UPDATELOG, updateResponse.updateLog);
}
}
});
}
示例7: onCreate
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
public void onCreate(Bundle savedInstanceState) {
//处理推送
delayStartActivityByPushIntent(mMainActivity.getIntent());
if (!BuildConfig.DEBUG) {
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(mMainActivity);
}
}
示例8: initData
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
@Override
public void initData() {
super.initData();
UmengUpdateAgent.update(this);
UmengUpdateAgent.setUpdateOnlyWifi(true);
mPresenter.initAdapterData(adapter);
}
示例9: initUmeng
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
@Override
public void initUmeng(Context context) {
if (App.getApp() != null && App.getApp().getEdition() == Edition.DEBUG) {
MobclickAgent.setDebugMode(true);
MobclickAgent.setCatchUncaughtExceptions(false);
UpdateConfig.setDebug(true);
} else {
UmengUpdateAgent.setUpdateCheckConfig(false);
}
// Fix bug for downloading always
UmengUpdateAgent.setDeltaUpdate(false);
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.setUpdateUIStyle(UpdateStatus.STYLE_DIALOG);
UmengUpdateAgent.setUpdateAutoPopup(false);
}
示例10: checkVersion
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
static public void checkVersion(Context context, UmengUpdateListener umengUpdateListener) {
UmengUpdateAgent.setDeltaUpdate(false);
UmengUpdateAgent.setUpdateOnlyWifi(true);
UmengUpdateAgent.setUpdateAutoPopup(false);
UmengUpdateAgent.setUpdateListener(umengUpdateListener);
UmengUpdateAgent.update(context);
}
示例11: onCreate
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(R.string.app_title);
mPresenter.request(this, Constants.USER_GUIDE);
UmengUpdateAgent.setUpdateAutoPopup(true);
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
}
示例12: onCreate
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//注册广播接收器,接收网络连接变化
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
this.registerReceiver(netReceiver, filter);
sp = getSharedPreferences(Constants.SP_USER,0);
//友盟自动更新
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
//启动服务,获取留言消息
startService(new Intent(this, LocalMessageServer.class));
//注册本地广播,接收留言消息
localBroadcastManager = LocalBroadcastManager.getInstance(this);
IntentFilter intentFilter = new IntentFilter(LOCAL_MESSAGE_ACTION);
messageReceiver = new LocalMessageReceiver();
localBroadcastManager.registerReceiver(messageReceiver, intentFilter);
fragments = new ArrayList<>();
home = HomeFragment.getInstance();
commit = CommitFragment.getInstance();
commit.setContext(this);
message = MessageFragment.getInstance();
message.setMessageChangListener(this);
message.setContext(this);
fragments.add(home);
fragments.add(commit);
fragments.add(message);
initView();
}
示例13: onCreate
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.almanac_activity);
calendar = Calendar.getInstance(Locale.CHINA);
initView();
updateView();
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
mController = UMServiceFactory.getUMSocialService("com.umeng.share",
RequestType.SOCIAL);
mController.getConfig().setSsoHandler(new SinaSsoHandler());
String appID = "wx4f7f32d56bb3ddb6";
String contentUrl = "http://www.wandoujia.com/apps/com.nozomi.almanac";
mController.getConfig().supportWXPlatform(this, appID, contentUrl);
mController.getConfig()
.supportWXCirclePlatform(this, appID, contentUrl);
mShakeController = UMShakeServiceFactory
.getShakeService("com.umeng.share");
mShakeController.setShareContent("#Acfun黄历#");
platforms.add(SHARE_MEDIA.SINA);
platforms.add(SHARE_MEDIA.WEIXIN);
platforms.add(SHARE_MEDIA.WEIXIN_CIRCLE);
appAdapter = new UMAppAdapter(AlmanacActivity.this);
}
示例14: initUmeng
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
private void initUmeng() {
// 友盟自动检测更新
if(SpUtil.getSp(this).getBoolean("auto_update",false)){
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
}
FeedbackAgent agent = new FeedbackAgent(this);
agent.sync();
}
示例15: onCreate
import com.umeng.update.UmengUpdateAgent; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 版本更新自动敬爱呢
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
// oline config params
String onlineParams= MobclickAgent.getConfigParams(getApplicationContext(), "hello_test");//the demo param's key is 'abc'
System.out.println("======" +onlineParams);
// 统计测试
GKStatics.onEvent(this, GKStatics.event_main);;
// set the Above View
if (savedInstanceState != null)
mContent = getSupportFragmentManager().getFragment(savedInstanceState, "mContent");
if (mContent == null)
mContent = new GKContentFragment(R.color.blue);
// set the Above View
setContentView(R.layout.content_frame);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.content_frame, mContent)
.commit();
// set the Behind View
setBehindContentView(R.layout.menu_frame);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.menu_frame, new GKMenuFragment())
.commit();
// customize the SlidingMenu
getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
}