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


Java UmengUpdateAgent類代碼示例

本文整理匯總了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);
}
 
開發者ID:isuhao,項目名稱:QMark,代碼行數:20,代碼來源:CategoryActy_v_1.java

示例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;
            }
        }
    });

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

示例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);
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:25,代碼來源:MainActivity.java

示例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);

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

示例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);
}
 
開發者ID:SwiftyWang,項目名稱:FingerColoring-Android,代碼行數:25,代碼來源:UmengUtil.java

示例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();
    }

}
 
開發者ID:JoeSteven,項目名稱:Moring-Alarm,代碼行數:27,代碼來源:HomeActivity.java

示例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);
}
 
開發者ID:CaMnter,項目名稱:EasyGank,代碼行數:23,代碼來源:MainActivity.java

示例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);
	}
 
開發者ID:cowthan,項目名稱:AyoSunny,代碼行數:26,代碼來源:AppUpdateUtils.java

示例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);
}
 
開發者ID:cowthan,項目名稱:AyoSunny,代碼行數:21,代碼來源:AppUpdateUtils.java

示例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);

  }
 
開發者ID:jp1017,項目名稱:TheSceneryAlong,代碼行數:21,代碼來源:MainActivity.java

示例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));
    }
 
開發者ID:overlooping,項目名稱:GankMeizhi,代碼行數:20,代碼來源:MainActivity.java

示例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 {

    }
}
 
開發者ID:a741762308,項目名稱:MultiChannelPack,代碼行數:23,代碼來源:MainActivity.java

示例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;
	        }
	    }
	});
}
 
開發者ID:liuling07,項目名稱:QiQuYing,代碼行數:24,代碼來源:UserCenterActivity.java

示例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;
    }
}
 
開發者ID:maoruibin,項目名稱:AppPlus,代碼行數:18,代碼來源:AboutFragment.java

示例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);
}
 
開發者ID:AndroidCreativeDesign,項目名稱:AndroidSharingPlatform,代碼行數:23,代碼來源:MainActivity.java


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