-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hey Nathan.
Recall that after class I showed you the problem with the final page of images hitting the exception, which prevented them from being added and prevented the scroll listener from resetting.
We solved it for now with a dummy input:
new JsonHttpResponseHandler(){
public void onSuccess(JSONObject response){
JSONArray imageJsonResults = null;
try {
imageJsonResults = response.getJSONObject(
"responseData").getJSONArray("results");
imageAdapter.addAll(ImageResult
.fromJSONArray(imageJsonResults));
Log.d("DEBUG", imageResults.toString());
} catch (JSONException e) {
//Dummy image added to reset EndlessScrollListener - exception hit on page 9
imageAdapter.add(new ImageResult(new JSONObject()));
e.printStackTrace();
}
}
}
You mentioned improvements could be made.
I plan to look into it tomorrow. Let me know if you find anything yourself.
/cc @nesquena