本文整理匯總了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;
}
示例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) {
}
});
}
示例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) {
}
});
}
示例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);
}
}
示例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);
}
});
}
}
示例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);
}
}
示例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();
}
}
示例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);
}
});
}
示例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));
}
}
示例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;
}
}
示例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();
}
}
示例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();
}
}
示例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());
}
}
示例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();
}
}
示例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();
}
}