I am new to AsyncHttpClient and I am not able to implement AsyncHttpResponseHandler. Whenever I implement it, I have to override 2 methods onSuccess and onFailure.
Both these methods are taking as parameter the following:-
client.get(cityURL, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int i, cz.msebera.android.httpclient.Header[] headers, byte[] bytes) {
}
@Override
public void onFailure(int i, cz.msebera.android.httpclient.Header[] headers, byte[] bytes, Throwable throwable) {
}
I am getting error in 'cz' saying Cannot recognize symbol 'cz'. I have tried adding the following dependencies :-
- compile 'com.loopj.android:android-async-http:1.4.9'
- compile 'org.apache.httpcomponents:httpcore:4.4.1'
But sync is failing if I use them. Any help on this would be much appreciated.