blurpy/kouchat-android — Issue #1: Crashes when sending messages in Android 4.0
Author: blurpy
Created: 2011-11-27 15:33:38+00:00
State: open

More details about the issue at: http://rashidnoorani.blogspot.com/2011/04/why-do-you-get-androidosnetworkonmainth.html

Stack trace:

```
11-27 15:24:38.879: WARN/dalvikvm(543): threadid=1: thread exiting with uncaught exception (group=0x409951f8)
11-27 15:24:38.909: ERROR/AndroidRuntime(543): FATAL EXCEPTION: main
android.os.NetworkOnMainThreadException
at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1084)
at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:163)
at libcore.io.IoBridge.sendto(IoBridge.java:463)
at java.net.PlainDatagramSocketImpl.send(PlainDatagramSocketImpl.java:182)
at java.net.DatagramSocket.send(DatagramSocket.java:287)
at net.usikkert.kouchat.net.MessageSender.send(MessageSender.java:124)
at net.usikkert.kouchat.net.NetworkService.sendMulticastMsg(NetworkService.java:148)
at net.usikkert.kouchat.net.Messages.sendChatMessage(Messages.java:147)
at net.usikkert.kouchat.misc.Controller.sendChatMessage(Controller.java:452)
at net.usikkert.kouchat.android.AndroidUserInterface.sendMessage(AndroidUserInterface.java:187)
at net.usikkert.kouchat.android.controller.MainChatController.sendMessage(MainChatController.java:259)
at net.usikkert.kouchat.android.controller.MainChatController$2.onKey(MainChatController.java:134)
at android.view.View.dispatchKeyEvent(View.java:5417)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1242)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1242)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1242)
at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1242)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:1849)
at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1351)
at android.app.Activity.dispatchKeyEvent(Activity.java:2324)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1796)
at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3264)
at android.view.ViewRootImpl.handleFinishedEvent(ViewRootImpl.java:3237)
at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2400)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
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:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
```