Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.Exception: java.io.InterruptedIOException #4

Open
rexi1r opened this issue Aug 30, 2015 · 6 comments
Open

java.lang.Exception: java.io.InterruptedIOException #4

rexi1r opened this issue Aug 30, 2015 · 6 comments

Comments

@rexi1r
Copy link

rexi1r commented Aug 30, 2015

hi
I'm getting the above error When for the first time open the activity.

@asifmujteba
Copy link
Owner

please post your code.. are u sure this caused by EasyVolley ?

@rexi1r
Copy link
Author

rexi1r commented Aug 31, 2015

yes i'm sure.
when for a first time i open the activity.and click on the send request for twice time i got the above error and after that the request send successfully.

@asifmujteba
Copy link
Owner

Can you please post your code ?

@rexi1r
Copy link
Author

rexi1r commented Aug 31, 2015

 App.getInstance().getServerController().SearchCourse(getActivity(),
                new ServerController.OnServerResponseListener<ArrayList<CourceParcel>>() {
                    @Override
                    public void onSuccess(ArrayList<CourceParcel> response) {

                        ((BaseActivity) getActivity()).hideProgressBar();
                        productsAdapter = new ProductsAdapter(getActivity(), response);

                        swtichToCourseFragment();

                        //productsAdapter.setProductsAndNotify(response);
                    }

                    @Override
                    public void onError(Exception e) {
                        ((BaseActivity) getActivity()).hideProgressBar();
                        App.showToast(e.getMessage());
                    }
                }, Crs_Cod, Daneshkade, CRS_NAME, INST_FAMILY, Cookie);

and the method that called:

    public void SearchCourse(Object subscriber,
                             final OnServerResponseListener<ArrayList<CourceParcel>> listener, String Crs_Cod, String Daneshkade, String CRS_NAME, String INST_FAMILY, String Cookie) {
        EasyVolley.withGlobalQueue()
                .load(ASFRequest.METHOD.GET, URLBase)
                .addParam("operation", "getdistinct")
                .addParam("Crs_Cod", Crs_Cod)
                .addParam("Daneshkade", Daneshkade)
                .addParam("CRS_NAME", CRS_NAME)
                .addParam("INST_FAMILY", INST_FAMILY)
                .addParam("Cookie", Cookie)
                .asJsonObject()
                .setSubscriber(subscriber)
                .setCallback(new ASFRequestListener<JsonObject>() {
                    @Override
                    public void onSuccess(JsonObject response) {

                        JsonArray results = response.get("GetDISTINCT").getAsJsonArray();
                        ArrayList<CourceParcel> products = CourceParcel.parseJsonArray(results);
                        if (listener != null) {
                            listener.onSuccess(products);
                        }
                    }


                    @Override
                    public void onFailure(Exception e) {
                        Log.e(Utility.TAG_STRING, e.toString());
                        Log.e(Utility.TAG_STRING, e.getMessage() + "test");
                        if (listener != null) {
                            listener.onError(e);
                        }
                    }
                })
                .start();
    }

@DenisMondon
Copy link

Hi!
I have the same issue but it is random!
Sometimes, the request succeeds, but sometimes I have InterruptedIOException...

Denis

@5force
Copy link

5force commented Jun 19, 2017

Hi.
You just need to remove
mRequestQueueWeakReference.get().start();
from ASFRequest.start()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants