0

I am using the Asynchronous Http Client of the LoopJ Library. I want it to become more robust, so if there is a Onfailure , the Params get saved and tried again later in a interval for example 1 hour. Now my question is, is there a possibility to grab the Requestparams in the OnFailure Callback so I can use them again later?

Or is there a better Opportunity anyone can think of?

    loginparams=new RequestParams();
    loginparams.put("username", email);
    loginparams.put("password", password);
    loginClient.doLogin(loginparams, new AsyncHttpResponseHandler() {

 @Override
                public void onFailure(int i, cz.msebera.android.httpclient.Header[] headers, byte[] bytes, Throwable throwable) {
                    checker1=false;
                    Log.v("MYLOG", "On START"+checker1);
                }
O.Bey
  • 29
  • 7

1 Answers1

1

We can add retry:

 @Override
 public void onRetry(int retryNo) {
     // Request was retried
 }

loopj-link

Vishal Raj
  • 1,755
  • 2
  • 16
  • 35