use of com.ichi2.anki.multimediacard.googleimagesearch.json.ResponseData in project Anki-Android by Ramblurr.
the class SearchImageActivity method postFinished.
public void postFinished(ImageSearchResponse response) {
ArrayList<String> theImages = new ArrayList<String>();
// No loop, just a good construct to break out from
do {
if (response == null)
break;
if (response.getOk() == false)
break;
ResponseData rdata = response.getResponseData();
if (rdata == null)
break;
List<Result> results = rdata.getResults();
if (results == null)
break;
for (Result result : results) {
if (result == null) {
continue;
}
String url = result.getUrl();
if (url != null) {
theImages.add(url);
}
}
if (theImages.size() == 0)
break;
proceedWithImages(theImages);
return;
} while (false);
returnFailure(gtxt(R.string.multimedia_editor_imgs_no_results));
}
Aggregations