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


Java Background類代碼示例

本文整理匯總了Java中org.androidannotations.annotations.Background的典型用法代碼示例。如果您正苦於以下問題:Java Background類的具體用法?Java Background怎麽用?Java Background使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: performVote

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
public void performVote(VoteDirection voteDirection) {
    if (this.currentlyVoting) {
        return;
    }

    this.currentlyVoting = true;

    VoteDirection oldDirection = this.currentVoteDirection;

    if (voteDirection == oldDirection) {
        voteDirection = VoteDirection.NO_VOTE;
    }

    // update vote on ui instantly, reverting if it fails
    this.setVoteDirection(voteDirection);

    try {
        this.manager.getAccountManager().vote(this.upvotable, voteDirection);
    } catch (ApiException ex) {
        Log.e("vote", ex.toString());
        this.setVoteDirection(oldDirection);
    }

    this.currentlyVoting = false;
}
 
開發者ID:AlbinoDrought,項目名稱:party-reader,代碼行數:27,代碼來源:Upvoter.java

示例2: getTimeFramesList

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background(serial = "serial")
@Override
public void getTimeFramesList(final ILoadCallback<List<DataTimeFrame>> pLoadCallback) {
    ensureConferenceLoaded();
    if (mMemCacheTimeFrame != null) {
        this.onUiThreadCallOnSuccessCallback(pLoadCallback, mMemCacheTimeFrame);
        return;
    }
    this.mLocalSnappyDataSource.getTimeFramesList(new ILoadCallback<List<DataTimeFrame>>() {
        @Override public void onSuccess(List<DataTimeFrame> pObject) {
            if (pObject == null) {
                this.onFailure(new DataNotFoundException());
                return;
            }
            mMemCacheTimeFrame = pObject;
            onUiThreadCallOnSuccessCallback(pLoadCallback, pObject);
        }

        @Override public void onFailure(Exception pException) {

        }
    });
}
 
開發者ID:AndroidIasi,項目名稱:CodeCamp,代碼行數:24,代碼來源:AgendaRepository.java

示例3: getCodecampersList

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background(serial = "serial")
@Override
public void getCodecampersList(final ILoadCallback<List<DataCodecamper>> pLoadCallback) {
    ensureConferenceLoaded();
    if (mMemCacheDataCodecampers != null) {
        this.onUiThreadCallOnSuccessCallback(pLoadCallback, mMemCacheDataCodecampers);
        return;
    }
    this.mLocalSnappyDataSource.getCodecampersList(new ILoadCallback<List<DataCodecamper>>() {
        @Override public void onSuccess(List<DataCodecamper> pObject) {
            if (pObject == null) {
                this.onFailure(new DataNotFoundException());
                return;
            }
            mMemCacheDataCodecampers = pObject;
            onUiThreadCallOnSuccessCallback(pLoadCallback, pObject);
        }

        @Override public void onFailure(Exception pException) {

        }
    });
}
 
開發者ID:AndroidIasi,項目名稱:CodeCamp,代碼行數:24,代碼來源:AgendaRepository.java

示例4: createChannelSMS

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
@Override
void createChannelSMS(){
    if (hcPhoneNo1 != null && !hcPhoneNo1.trim().equals("")) {
        log.info("create channel and send sms...");

        Channel channel = createChannel();

        String command = SMSCommandUtil.getH2CExchange(channel.qh, channel.channelId);
        SMSUtil.sendSMS(hcPhoneNo1, command, sendIntent, backIntent);
    }else {
        String msg = "Please configure the phone number of open platform first";

        log.info(msg);
        showMsg(msg);
    }
}
 
開發者ID:chaincloud-dot-com,項目名稱:chaincloud-v,代碼行數:18,代碼來源:SMSServiceImpl.java

示例5: onRefresh

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Override
@Background
public void onRefresh() {
    adapter.setLoading(true);
    List<AddressHistory> addressHistories = null;
    try {
        if(isHot) {
            addressHistories = Api.apiService(ChainCloudHotSendService.class)
                    .addressHistory(GlobalParams.coinCode, path.value(), null);
        }else {
            addressHistories = Api.apiService(ChainCloudColdReceiveService.class)
                    .addressHistory(GlobalParams.coinCode, path.value(), null);
        }

        apiDataListGot(true, addressHistories);
    } catch (RetrofitError e) {
        apiDataListGot(true, null);
        refresher.post(new Runnable() {
            @Override
            public void run() {
                adapter.setLoading(false);
                refresher.setRefreshing(false);
            }
        });
    }
}
 
開發者ID:chaincloud-dot-com,項目名稱:chaincloud-v,代碼行數:27,代碼來源:AddressHistoryActivity.java

示例6: onPageAutoLoad

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Override
@Background
public void onPageAutoLoad() {
    if (addresses.size() == 0) {
        apiDataListGot(false, null);
        return;
    }
    List<AddressHistory> addressHistories = null;
    try {
        if(isHot) {
            addressHistories = Api.apiService(ChainCloudHotSendService.class)
                    .addressHistory(GlobalParams.coinCode, path.value(), addresses.get(addresses.size() - 1).address);
        }else {
            addressHistories = Api.apiService(ChainCloudColdReceiveService.class)
                    .addressHistory(GlobalParams.coinCode, path.value(), addresses.get(addresses.size() - 1).address);
        }

        apiDataListGot(false, addressHistories);
    } catch (RetrofitError e) {
        e.printStackTrace();
        apiDataListGot(false, null);
    }
}
 
開發者ID:chaincloud-dot-com,項目名稱:chaincloud-v,代碼行數:24,代碼來源:AddressHistoryActivity.java

示例7: loadUser

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
void loadUser() {
    try{
        if (isHot) {
            user = chainCloudHotSendService.currentUser(GlobalParams.coinCode);
        }else {
            user = chainCloudColdReceiveService.currentUser(GlobalParams.coinCode);
        }

        showUser(user);
    }catch (RetrofitError error){
        showNetException(error);
        return;
    }finally {
        closeRefresh();
        closeProgress();
    }
}
 
開發者ID:chaincloud-dot-com,項目名稱:chaincloud-v,代碼行數:19,代碼來源:AddressDetailActivity.java

示例8: getDataFromServer

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
void getDataFromServer() {
    try {
        Tx detail = null;
        if (isHot) {
            detail = Api.apiService(ChainCloudHotSendService.class).getDetail(GlobalParams.coinCode, tx.getTxHash());
        }else {
            detail = Api.apiService(ChainCloudColdReceiveService.class).getDetail(GlobalParams.coinCode, tx.getTxHash());
        }
        tx = detail;
        showtx();
    } catch (RetrofitError ex) {
        ex.printStackTrace();
    }
    refresher.post(new Runnable() {
        @Override
        public void run() {
            refresher.setRefreshing(false);
        }
    });
}
 
開發者ID:chaincloud-dot-com,項目名稱:chaincloud-v,代碼行數:22,代碼來源:TxDetailActivity.java

示例9: doMusicScan

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background // because it involves network
void doMusicScan() {
    try {
        ChannelSftp channelSftp = sftpManager.connectAndGetSftpChannel();
        musicScanner.setProgressListener(new MusicScanner.ProgressListener() {
            @Override
            public void onNewDir(String path) {
                setStatus(path);
            }
        });
        musicScanner.doMusicScan(channelSftp);
        setStatus("finished!");
    }
    catch(Exception e) {
        setStatus(e.toString());
        Log.e(TAG, Log.getStackTraceString(e));
    }

}
 
開發者ID:egueli,項目名稱:ETStreamHome,代碼行數:20,代碼來源:MyActivity.java

示例10: getData

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
void getData() {
    try {
        int userId = getActivity().getSharedPreferences(Constants.LOGIN_TIMES, 0).getInt("uid", 0);
        mAwardRequest.setUserId(userId);
        //1 出租 2 出售 (目前默認1)  type
        if (mType.equals("rent")) {
            mAwardRequest.setType(1);
        } else {
            mAwardRequest.setType(2);
        }
        mAwardResponse = mMonthawardService.getMonthAward(mAwardRequest);
        setView();
    } catch (Exception e) {
        throw e;
    }

}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:19,代碼來源:ClassificationRewardFragment.java

示例11: getData

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
@Override
public void getData(boolean b) {
	showBottomOnHasMoreData();

	mReq.setStart(0);
	mReq.setMax(25);

	try {
		if (b) {
			mRes = mHousereSourceService.findSellByPage(mReq);
		} else {
			mRes = mHousereSourceService.findSellByPage2(mReq);

		}
		setCatchLayoutVisible(View.GONE);
	} catch (final Exception e) {
		catchSet(e);
		mCurrentFlag = FLAG_GETDATA;
		throw e;

	} finally {
		upData();
	}
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:26,代碼來源:SellSearchResultFragment.java

示例12: loadByConditions

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
@Override
public void loadByConditions() {
	showBottomOnHasMoreData();

	mReq.setStart(0);
	mReq.setMax(25);

	try {
		mRes = mHousereSourceService.findSellByPage(mReq);
		setCatchLayoutVisible(View.GONE);
	} catch (final Exception e) {
		catchSet(e);
		mCurrentFlag = FLAG_CONDITION;
		throw e;
	} finally {
		upData();
	}
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:20,代碼來源:SellSearchResultFragment.java

示例13: recordInfoRequest

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
public void recordInfoRequest() {

	try {
		if (releaseTypeId == Constants.RECORD_INFO_RENT) {
			recordInfoRequest.setHistoryId(historyId);
			mReleaseRecordInfoResponse = mRentService.rentRecordInfo(recordInfoRequest);
		} else if (releaseTypeId == Constants.RECORD_INFO_SELL) {
			recordInfoRequest.setHistoryId(historyId);
			mReleaseRecordInfoResponse = mSellService.sellRecordInfo(recordInfoRequest);
		}
		recordGetInfo();
	} catch (Exception e) {
		onRecordInfoRequestError(e.getMessage());
	}
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:17,代碼來源:ReleasedRecordInfoFragment.java

示例14: loadMore

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
@Override
public void loadMore() {

	mReq.setStart(mRes.getHouseList().size());
	mReq.setMax(25);

	try {

		List<HouseInfo> list = mHousereSourceService.findRentByPage2(mReq).getHouseList();
		mRes.getHouseList().addAll(list);
		if (list.size() == 0 || list.size() < 25) {
			showBottomOnDataEnd();
		}
		setCatchLayoutVisible(View.GONE);
	} catch (final Exception e) {
		catchSet(e);
		mCurrentFlag = FLAG_LOADMORE;
		throw e;
	} finally {
		upData();
	}

}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:25,代碼來源:RentSearchResultFragment.java

示例15: getData

import org.androidannotations.annotations.Background; //導入依賴的package包/類
@Background
@Override
public void getData(boolean b) {
	showBottomOnHasMoreData();
	mReq.setStart(0);
	mReq.setMax(25);

	try {
		if (b) {
			mRes = mHousereSourceService.findRentByPage(mReq);
		} else {
			mRes = mHousereSourceService.findRentByPage2(mReq);
		}
		setCatchLayoutVisible(View.GONE);
	} catch (final Exception e) {
		catchSet(e);
		catchSet(e);
		mCurrentFlag = FLAG_CONDITION;
		mCurrentFlag = FLAG_GETDATA;
	} finally {
		upData();
	}

}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:25,代碼來源:RentSearchResultFragment.java


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