1

I'm trying to get cookie from server response (from Headers).

I built library from source : https://github.com/loopj/android-async-http and add it to my project. Here i try to override metod

client.post(context, link,  requestEntity, contentType, new AsyncHttpResponseHandler() {            
    @Override
    public void onSuccess(int statusCode, Header[] headers, String content) {
        Log.d("headers", String.valueOf(headers));
        onSuccess(statusCode, content);
    }
});

but get error :

The method onSuccess(int, PreferenceActivity.Header[], String) of type new AsyncHttpResponseHandler(){} must override or implement a supertype method

AsyncHttpResponseHandler.java

How I can override this metod or get Headers?

1
  • Check your imports, PreferenceActivity.Header[] does not look like a type for AsyncHttpResponseHandler. Commented Jul 30, 2013 at 12:02

2 Answers 2

0

Headers type supposed to be org.apache.http.Header[] instead of Header[]

Sign up to request clarification or add additional context in comments.

Comments

0

I have ever faced with this problem. Try to open your gradle (Gradle Scripts), edit your build.gradle(Module:app) by adding:

dependencies {
 compile 'com.loopj.android:android-async-http:1.4.9'
}

after your gradle running, try import cz.msebera.android.httpclient.Header;

I hope it will help you :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.