如何让安卓AQuery从互联网下载数据,如果可能,否则-从缓存?我的代码:
final GetFeedsAjaxCallback ac = new GetFeedsAjaxCallback(...);
aq.ajax(feed, XmlDom.class, -1, ac);如果没有互联网连接,我的代码将无法工作。
发布于 2015-08-29 00:09:44
使用代码:
AQuery aq;
//...
final GetFeedsAjaxCallback ac = new GetFeedsAjaxCallback(...);
aq.ajax(feed, XmlDom.class, -1, ac);..。
if (status.getCode() != 200 || xml == null)
try {
xml = new com.androidquery.util.XmlDom(new FileInputStream(aq.getCachedFile(url)));
}
catch (Exception e){}
//do somethinghttps://stackoverflow.com/questions/32272329
复制相似问题