[Android Q&A, Help & Troubleshooting] tevfikaktas:
Sorry for my bad english, but i have problem and can't figure it out..

I have custom listview in my fragment for getting products from JSON array. And I have 3 ImageButtons in every listview row;

Plus Button(+), Minus Button(-) and Remove Button(X)..

So when i click each button, its calling JSON request for update product's piece number, getting new datas from response and repopulate array list.

Everything ok but, when I click that buttons faster, it seems there is 1 sec delay between multiple requests even first volley request has already done before.

Here is my JSON method in TableAdapter.java

[SIZE="3"]public void JSON(final int position, final int process) {

if (inProgress==false) {
dialog = new ProgressDialog(myContext);
dialog.setMessage("Updating.....");
dialog.show();
inProgress = true;
System.out.println("**** Now request is beginning............");

final int rowID = tableModelList.get(position).getID();
final int treeID = tableModelList.get(position).getAna_dal();
final float price = tableModelList.get(position).getBFiyat();
final int quantity = tableModelList.get(position).getAdet();
final int print = tableModelList.get(position).getYazdimi();

final String insertUrl = "This is URL for getting json array";

Map<String, String> parameters = new HashMap<>();
parameters.put("tableID", "" + getTableId);
parameters.put("rowID", "" + rowID);
parameters.put("treeID", ""+treeID);
parameters.put("process",""+process);
parameters.put("quantity",""+quantity);
parameters.put("price",""+price);
parameters.put("print",""+print);

CustomRequest jsObjRequest = new CustomRequest(Request.Method.POST, insertUrl, parameters, new Response.Listener<JSONObject>() {

@Override
public void onResponse(JSONObject response) {
try {
JSONArray getOrders = response.getJSONArray("order");

Gson gson = new Gson();

tableModelList.clear();
for (int i = 0; i < getOrders.length(); i++) {
JSONObject order = getOrders.getJSONObject(i);

TableModel tableModel = gson.fromJson(order.toString(), TableModel.class);
tableModelList.add(tableModel);
}

mAdapter.notifyDataSetChanged();

System.out.println("**** onResponse: Request is done............");
System.out.println("**** JSON: "+response.toString());

dialog.cancel();
inProgress = false;

} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {

@Override
public void onErrorResponse(VolleyError response) {
Log.d("Response: ", response.toString());
inProgress = false;
}
});

requestQueue.add(jsObjRequest);
}
}[/SIZE]

Dialog is showing when request beginning and canceling when request is done. But as I said, when I click faster, there is a delay between multiple requests even first request has already done. I'm saying 1 sec, because 2nd request is beginning after 1 sec exactly, no matter how I clicking fast. I can't figure it out..

I tested fast clicks to showing toasts with random numbers and it's working fine. But when I testing with JSON method, there is a weird delay.

I have SwipeRefreshLayout and ScrollView in my fragment. I'm using Volley with singleton.

Here is video to showing what my problem is;

[YOUTUBE]4oGUAOZMnkw[/YOUTUBE]

Here is Logcat output for every click

[YOUTUBE]oaChhvam2Tg[/YOUTUBE]

Every fast click has returning success json output, but nothing change instantly on the screen..

Thanks for your help.