public void parseInfo(String genderTxt2, Boolean gender){
final String URL = "url" +
"?adult=" + isAdult.toString() + "&gender=" + genderTxt2;
info_text.setVisibility(View.GONE);
listview_progress.setVisibility(View.VISIBLE);
mRequestQueue.add(new JsonObjectRequest(Request.Method.GET,URL,null,new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
if (!fPullToRefreshAttacher.isRefreshing()) {
names.clear();
}
VolleyLog.v("Response:%n %s", response.toString(4));
adapter.clear();
parseJSON(response);
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// VolleyLog.e("Error: ", error.getMessage().toString());
Toast.makeText(acc, "Unable to load names list! Please check connection", Toast.LENGTH_LONG).show();
}
}));
mRequestQueue.start();
}
十分に単純で、多くのデバイスで OutOfMemory 例外が発生します。何か案は?