I have the next strange problem, I'm trying to parse response with JSON data in background, because there's a lot of data and call it like this:

```
protected AsyncTask<JSONObject, Void, Void> createParseTask() {

    return new AsyncTask<JSONObject, Void, Void>() {
        @Override
        protected Void doInBackground(JSONObject... jsonObjects) {
            parseResponse(jsonObjects[0]);
            return null;
        }

        @Override
        protected void onPostExecute(Void aVoid) {
            super.onPostExecute(aVoid);

            mProgressBar.setVisibility(View.GONE);
            if (!mEmpty) {
                if (swipeRefresh.isRefreshing()) {
                    swipeRefresh.setRefreshing(false);
                    mAdapter.notifyDataSetChanged();
                } else if(!mShowStored) {
                    mAdapter.notifyDataSetChanged();
                }
            } else if (mShowStored) {
                mProgressBar.setVisibility(View.GONE);
            } else {
                internetError.setVisibility(View.VISIBLE);
          internetError.setText(getActivity().getResources().getString(R.string.emptyRequestError));
            }

            if (!mShowStored) {
                checkData();
            }

        }
    };

}

```

And the parseResponse() method is written like this:

```
protected void parseResponse(JSONObject response) {

    JSONArray jsonArray = null;
    JsonParser parser = new JsonParser();
    OrdersDatabase ordersDatabase = new OrdersDatabase(AppController.getAppContext());
    try {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(AppController.getAppContext());
        SharedPreferences.Editor editor = sp.edit();
        String dateTime = response.getString("serverDateTime");
        dateTime = dateTime.replace(":", "%3A");
        dateTime = dateTime.replace("+", "%2B");
        editor.putString("serverDateTime", dateTime);
        editor.apply();
        jsonArray = response.getJSONArray("updatedOrders");
        JSONArray active = response.getJSONArray("activeOrders");
        if (jsonArray.length() == 0 && active.length() == 0) {
            mEmpty = true;
        } else if (response.length() > 0 || jsonArray.length() > 0 && active.length() > 0) {
            for (int i = 0; i < jsonArray.length(); i++) {
                JsonElement jsonElement = new JsonParser().parse(String.valueOf(jsonArray.get(i)));
                JsonObject jsonObject = jsonElement.getAsJsonObject();

                String orderID = jsonObject.getAsJsonPrimitive("id").getAsString();

                if (!mShowStored) {
                    if (!ordersDatabase.checkOrder(orderID)) {
                        ordersDatabase.addOrderData(jsonObject.getAsJsonPrimitive("id").getAsString(), String.valueOf(jsonObject));
                    } else {
                        ordersDatabase.updateOrderData(jsonObject.getAsJsonPrimitive("id").getAsString(), String.valueOf(jsonObject));
                    }
                }
            }
            for (int i = 0; i < active.length(); i++) {
                JSONObject jsonObject = active.getJSONObject(i);
                String activeOrder = jsonObject.getString("id");
                activeOrders.add(activeOrder);
                if (ordersDatabase.checkOrder(activeOrder)) {
                    if (!TextUtils.isEmpty(activeOrder)) {
                        JsonObject jsonOrder = (JsonObject) parser.parse(ordersDatabase.getOrderData(activeOrder));
                        cityList.add(OrderData.fromJson(jsonOrder));
                    }
                }
            }

        }

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

```

So I don't know how, but somehow the data appeared in RecyclerView is there before onPostExecute is shown, because in post execute the progressbar should go invisible and `notifydatasetchange` should also appear there. But data appears before the progressbar goes invisible and `notifyDataSetChange()` fired, help me please!