Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

network on main thread exception #3

Open
GoogleCodeExporter opened this issue Oct 12, 2015 · 0 comments
Open

network on main thread exception #3

GoogleCodeExporter opened this issue Oct 12, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I am using the same example. But its causing app crash.
here is my error log:

 FATAL EXCEPTION: main
    android.os.NetworkOnMainThreadException
            at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1128)
            at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:168)
            at libcore.io.IoBridge.sendto(IoBridge.java:531)
            at java.nio.SocketChannelImpl.writeImpl(SocketChannelImpl.java:378)
            at java.nio.SocketChannelImpl.write(SocketChannelImpl.java:336)
            at trackua.angstle.tracklocation.WebSocket.send(WebSocket.java:315)
            at trackua.angstle.tracklocation.FayeClient.handShake(FayeClient.java:139)
            at trackua.angstle.tracklocation.FayeClient.access$100(FayeClient.java:11)
            at trackua.angstle.tracklocation.FayeClient$1.handleMessage(FayeClient.java:98)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:153)
            at android.app.ActivityThread.main(ActivityThread.java:5299)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
            at dalvik.system.NativeStart.main(Native Method)

And please don't suggest to use StrictMode.ThreadPolicy...

Original issue reported on code.google.com by [email protected] on 19 Jun 2015 at 9:35

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

No branches or pull requests

1 participant