onSuccess not called
In some devices, onSuccess method is not called.
A workaround is clear application data and re-launch.
Same problem for me with Android 4.1 API 17 on Android Studio :
client.post("www.google.fr", new AsyncHttpResponseHandler() {
@Override
public void onStart() {
super.onStart();
Log.i("onStart", "OKOKOK");
}
@Override
public void onSuccess(String s) {
super.onSuccess(s);
Log.i("onSuccess", "OKOKOK");
}
@Override
public void onFinish() {
super.onFinish();
Log.i("onFinish", "OKOKOK");
}
@Override
public void onFailure(Throwable throwable, String s) {
super.onFailure(throwable, s);
Log.i("onFailure", "OKOKOK");
}
});
onStart function is called but nothing occur after.
Same problem for me in jelly bean. @loopj Could you please help me to sort this issue?
I've noticed this whenever making a request without a protocol (or just an invalid url in general.) Try adding "http://" in front of your url. It would be nice if the library would throw an error when given invalid urls but it seems to instead just not report the issue at all.
I ran into this issue with a fresh new application, turns out I forgot to add the internet permission.
I do think however that the AsyncHttpClient shouldn't swallow exceptions (like the networkonmainthread exception in my case), since that can be very confusing. I think in this case onFailure should just be called.
i have permission, i have http:// in my url, i test my url on browser and it works. i double double checked my url.
But it does not work. It does not return anything.