How to get Android AQuery to download data from the Internet, if possible, otherwise - from the cache ??? My code:
final GetFeedsAjaxCallback ac = new GetFeedsAjaxCallback(...);
aq.ajax(feed, XmlDom.class, -1, ac);
My code does not work if there is no internet connection.
use code:
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 something