Skip to content

fix an exception#533

Merged
smarek merged 1 commit into
android-async-http:masterfrom
superdry:fix
Apr 21, 2014
Merged

fix an exception#533
smarek merged 1 commit into
android-async-http:masterfrom
superdry:fix

Conversation

@superdry

Copy link
Copy Markdown
Contributor

Fix NetworkonmainthreadException occurs when AsyncHttpRequest.cancel(true) is called.

android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1117)
at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.close(OpenSSLSocketImpl.java:908)
at org.apache.http.impl.SocketHttpClientConnection.shutdown(SocketHttpClientConnection.java:183)
at org.apache.http.impl.conn.DefaultClientConnection.shutdown(DefaultClientConnection.java:150)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.shutdown(AbstractPooledConnAdapter.java:169)
at org.apache.http.impl.conn.AbstractClientConnAdapter.abortConnection(AbstractClientConnAdapter.java:378)
at org.apache.http.client.methods.HttpRequestBase.abort(HttpRequestBase.java:159)
at com.loopj.android.http.AsyncHttpRequest.cancel(AsyncHttpRequest.java:170)
at com.loopj.android.http.RequestHandle.cancel(RequestHandle.java:32)
at com.loopj.android.http.AsyncHttpClient.cancelRequests(AsyncHttpClient.java:565)

smarek added a commit that referenced this pull request Apr 21, 2014
@smarek
smarek merged commit f4cbff2 into android-async-http:master Apr 21, 2014

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a .start() is missing here, @smarek and @superdry.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I'll fix that in minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants