本文整理汇总了Java中net.tsz.afinal.http.AjaxCallBack类的典型用法代码示例。如果您正苦于以下问题:Java AjaxCallBack类的具体用法?Java AjaxCallBack怎么用?Java AjaxCallBack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AjaxCallBack类属于net.tsz.afinal.http包,在下文中一共展示了AjaxCallBack类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadDataRecentUseFromNet
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
private void loadDataRecentUseFromNet() {
try {
AjaxParams params = new AjaxParams();
App.getFHttp().get(Const.Url.recentUse,
App.getHeadersWithUidToken(),
params, new AjaxCallBack<String>() {
@Override
public void onSuccess(String json) {
L.d(FavoriteActy.class, json);
if (!App.checkApiJsonError(FavoriteActy.class, json)) {
parseRecentUseJson(json);
}
updateLoadingState(true, true);
if (mCurrentBtn == mRBtnRct) mImgState.setImageResource(R.drawable.img_m_favorite_recent_empty);
}
@Override
public void onFailure(Throwable t, int errorNo, String strMsg) {
App.handleApiWorkFailureAndFeedbackUser(FavoriteActy.class, ApiType.DEF, t, errorNo, strMsg);
updateLoadingState(true, true);
}
});
} catch (TokenNotValidException e) {
L.e(FavoriteActy.class, e);
}
}
开发者ID:isuhao,项目名称:QMark,代码行数:27,代码来源:FavoriteActy.java
示例2: loadData
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
private void loadData() {
try {
AjaxParams params = new AjaxParams();
params.put("pid", String.valueOf(mCategoryId));
App.getFHttp().get(Const.Url.getEditTempList(),
App.getHeadersWithUidToken(),
params, new AjaxCallBack<String>() {
@Override
public void onSuccess(String json) {
L.d(EditActy.class, json);
if (!App.checkApiJsonError(EditActy.class, json)) {
parseJson(json, true);
}
ensureViewState(false, false);
}
@Override
public void onFailure(Throwable t, int errorNo, String strMsg) {
App.handleApiWorkFailureAndFeedbackUser(EditActy.class, ApiType.DEF, t, errorNo, strMsg);
ensureViewState(false, false);
}
});
} catch (TokenNotValidException e) {
L.e(EditActy.class, e);
}
}
开发者ID:isuhao,项目名称:QMark,代码行数:27,代码来源:EditActy.java
示例3: commitFavoriteDelete
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
private void commitFavoriteDelete(Long[] tempIds) {
if (tempIds == null || tempIds.length == 0) return;
try {
AjaxParams params = new AjaxParams();
params.put("mid", ArrayUtils.join(tempIds, ","));
App.getFHttp().get(Const.Url.deleteFavorite,
App.getHeadersWithUidToken(),
params, new AjaxCallBack<String>() {
@Override
public void onSuccess(String json) {
L.d(FavoriteActy.class, json);
if (!App.checkApiJsonError(FavoriteActy.class, json)) {
//删除缓存
deleteFavoriteCache(mFavoritePage);
}
}
@Override
public void onFailure(Throwable t, int errorNo, String strMsg) {
loadDataFavoriteFromCache(1);
App.handleApiWorkFailureAndFeedbackUser(FavoriteActy.class, ApiType.FAV_DELETE, t, errorNo, strMsg);
}
});
} catch (TokenNotValidException e) {
L.e(FavoriteActy.class, e);
}
}
开发者ID:isuhao,项目名称:QMark,代码行数:28,代码来源:FavoriteActy.java
示例4: sendRequest
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
protected <T> void sendRequest(DefaultHttpClient client, HttpContext httpContext, HttpUriRequest uriRequest, String contentType, AjaxCallBack<T> ajaxCallBack) {
if(contentType != null) {
uriRequest.addHeader("Content-Type", contentType);
}
new HttpHandler<T>(client, httpContext, ajaxCallBack,charset)
.executeOnExecutor(executor, uriRequest);
}
开发者ID:DuGuQiuBai,项目名称:Android-Basics-Codes,代码行数:10,代码来源:FinalHttp.java
示例5: startDownloadFileByUrl
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
public DownloadFile startDownloadFileByUrl(String url, String toPath,
AjaxCallBack<File> downCallBack) {
if (downCallBack == null) {
throw new RuntimeException("AjaxCallBack对象不能为null");
} else {
FinalHttp finalHttp = new FinalHttp();
// 支持断点续传
setmHttpHandler(finalHttp.download(url, toPath, true, downCallBack));
// mHttpHandler.
}
return this;
}
开发者ID:samuelhehe,项目名称:AppMarket,代码行数:14,代码来源:DownloadFile.java
示例6: startDownloadFileByUrlNoCatch
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
public DownloadFile startDownloadFileByUrlNoCatch(String url,
String toPath, AjaxCallBack<File> downCallBack) {
if (downCallBack == null) {
throw new RuntimeException("AjaxCallBack对象不能为null");
} else {
FinalHttp down = new FinalHttp();
// 支持断点续传
setmHttpHandler(down.download(url, toPath, true, downCallBack));
// mHttpHandler.
}
return this;
}
开发者ID:samuelhehe,项目名称:AppMarket,代码行数:14,代码来源:DownloadFile.java
示例7: commitShare
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
private void commitShare() {
try {
if (mCommitList.size() == 0 || (mLocNet == null && mLocData == null)) return;
final CommitBean commitBean = mCommitList.get(0);
L.d(EditActy.class, "commitShare------templeId:" + commitBean.templeId + ", text:" + commitBean.text);
AjaxParams params = new AjaxParams();
params.put("zmid", String.valueOf(commitBean.templeId));
params.put("text", String.valueOf(commitBean.text));
//必填:token zmid text longitude latitude
//选填:city province city_name province_name address pinyin more
if (mLocNet != null) {
params.put("longitude", String.valueOf(mLocNet.longitude));
params.put("latitude", String.valueOf(mLocNet.latitude));
params.put("city", String.valueOf(mLocNet.cityCode));
params.put("province", String.valueOf(mLocNet.province));
params.put("city_name", String.valueOf(mLocNet.city));
params.put("province_name", String.valueOf(mLocNet.province));
params.put("address", String.valueOf(mLocNet.addrStr));
//params.put("pinyin", String.valueOf(mLocNet.pinyin));
//params.put("more", String.valueOf(mLocNet.more));
} else if (mLocData != null) {
params.put("longitude", String.valueOf(mLocData.longitude));
params.put("latitude", String.valueOf(mLocData.latitude));
}
App.getFHttp().get(Const.Url.createShareSimple,
App.getHeadersWithUidToken(),
params, new AjaxCallBack<String>() {
@Override
public void onSuccess(String json) {
mCommitList.remove(commitBean);
commitShare();
}
@Override
public void onFailure(Throwable t, int errorNo, String strMsg) {
App.handleApiWorkFailureAndFeedbackUser(EditActy.class, ApiType.COMMIT, t, errorNo, strMsg);
}
});
} catch (TokenNotValidException e) {
L.e(EditActy.class, e);
}
}
开发者ID:isuhao,项目名称:QMark,代码行数:46,代码来源:EditActy.java
示例8: get
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
public void get( String url, AjaxCallBack<? extends Object> callBack) {
get( url, null, callBack);
}
开发者ID:DuGuQiuBai,项目名称:Android-Basics-Codes,代码行数:4,代码来源:FinalHttp.java
示例9: post
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
public void post(String url, AjaxCallBack<? extends Object> callBack) {
post(url, null, callBack);
}
开发者ID:DuGuQiuBai,项目名称:Android-Basics-Codes,代码行数:4,代码来源:FinalHttp.java
示例10: put
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
public void put(String url, AjaxCallBack<? extends Object> callBack) {
put(url, null, callBack);
}
开发者ID:DuGuQiuBai,项目名称:Android-Basics-Codes,代码行数:4,代码来源:FinalHttp.java
示例11: download
import net.tsz.afinal.http.AjaxCallBack; //导入依赖的package包/类
public HttpHandler<File> download(String url,String target,AjaxCallBack<File> callback){
return download(url, null, target, false, callback);
}
开发者ID:DuGuQiuBai,项目名称:Android-Basics-Codes,代码行数:4,代码来源:FinalHttp.java
注:本文中的net.tsz.afinal.http.AjaxCallBack类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论