android-async-http icon indicating copy to clipboard operation
android-async-http copied to clipboard

onSuccess not called

Open kete1987 opened this issue 13 years ago • 5 comments

In some devices, onSuccess method is not called.

A workaround is clear application data and re-launch.

kete1987 avatar May 04 '13 14:05 kete1987

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.

djnivek avatar Jun 27 '13 09:06 djnivek

Same problem for me in jelly bean. @loopj Could you please help me to sort this issue?

nikhilchandran avatar Jul 26 '13 09:07 nikhilchandran

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.

vicapow avatar Aug 14 '13 17:08 vicapow

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.

pascalw avatar Aug 18 '13 11:08 pascalw

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.

alicanbatur avatar Mar 04 '14 18:03 alicanbatur