Looping AndroidNetworking.post passing all data don’t update on SQLite after Response Success

I’m having a problem updating data from SQLite when API response are success, for example, I have 5 pending data, My codes are getting and sending data from database. but only the last data had update in SQLite. I have logged ticket_tick_no_delayedinside onResponse and this is what I’ve get. any insights?.

enter image description here

Please take a look at my code:

private void checkingUnsendData() {

    String query = ("select * from tickets where is_send = '2' or is_send = '0' ");
    Cursor c = sqldb.rawQuery(query, null);

    if (c != null && c.moveToFirst()) {

        while (!c.isAfterLast()) {
            trip_no_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_TRIP_NO));
            ticket_control_no_delayed = c.getString(c.getColumnIndex(DBHelper.CONTROL_NO));
            ticket_tick_no_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_NO));
            ticket_datetime_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_DATETIME));
            ticket_kmfrom_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_KMFROM));
            ticket_kmto_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_KMTO));
            ticket_placefrom_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_PLACEFROM));
            ticket_placeto_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_PLACETO));
            ticket_amount_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_AMOUNT));
            ticket_discount_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_DISCOUNT));
            transaction_type_delayed = c.getString(c.getColumnIndex(DBHelper.TRANSACTION_TYPE));
            passenger_type_delayed = c.getString(c.getColumnIndex(DBHelper.PASSENGER_TYPE));
            ticket_lat_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_LAT));
            ticket_long_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_LONG));
            device_serial_delayed = c.getString(c.getColumnIndex(DBHelper.TICKET_DEVICE_SERIAL));

            sendUnsendData();

            c.moveToNext();
        }
    }
    c.close();
}

private void sendUnsendData() {
    JSONObject params = new JSONObject();

    try {
        params.put("control_no", ticket_control_no_delayed);
        params.put("trip_no", trip_no_delayed);
        params.put("ticket_no", ticket_tick_no_delayed);
        params.put("ticket_datetime", ticket_datetime_delayed);
        params.put("ticket_kmfrom", ticket_kmfrom_delayed);
        params.put("ticket_kmto", ticket_kmto_delayed);
        params.put("ticket_placefrom", ticket_placefrom_delayed);
        params.put("ticket_placeto", ticket_placeto_delayed);
        params.put("amount", ticket_amount_delayed);
        params.put("discount", ticket_discount_delayed);
        params.put("trans_type", transaction_type_delayed);
        params.put("passenger_type", passenger_type_delayed);
        params.put("lat", ticket_lat_delayed);
        params.put("long", ticket_long_delayed);
        params.put("device_serial", device_serial_delayed);


        AndroidNetworking.post("MY_LINK.COM")
                .addJSONObjectBody(params)
                .addHeaders("Content-Type", "application/json")
                .addHeaders("Prefer", "return=representation")
                .setPriority(Priority.HIGH)
                .build()
                .getAsJSONArray(new JSONArrayRequestListener() {
                    @Override
                    public void onResponse(JSONArray response) {
                        String qu = ("update tickets set is_send = '1' where ticket_tick_no = '" + ticket_tick_no_delayed + "'");
                        sqldb.execSQL(qu);

                        Log.e("ticket_tick_no_delayed", ticket_tick_no_delayed);
                    }

                    @Override
                    public void onError(ANError error) {
                        // handle error
                        asd(error);
                    }
                });

    } catch (Throwable e) {
        e.printStackTrace();
    }

}

EDIT

I’ve put log after the params.put... and I’m getting the data successfully.
see the image below:

enter image description here

Looping AndroidNetworking.post passing all data don’t update on SQLite after Response Success