Hi All,
Just got my first library working that is a wrapper for the asmack xmpp class library.
All is working fine, connects etc.
However
I am getting this log message when I try to open a toastmessage in an event raised..
The event is working fine otherwise !
ToastMessageShow(body, False)
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:121)
at android.widget.Toast.<init>(Toast.java:68)
at android.widget.Toast.makeText(Toast.java:231)
at anywheresoftware.b4a.keywords.Common.ToastMessageShow(Common.java:350)
at com.exg.Smack.main._xmpp_packetreceived(main.java:294)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:104)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:88)
at nejolaSmack.nejolaSmackClass$1.processPacket(nejolaSmackClass.java:122)
at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader.java:819)
at org.jivesoftware.smack.PacketReader$ListenerNotification.run(PacketReader.java:799)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
at java.lang.Thread.run(Thread.java:1102)
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
Any thoughts please ?
Thanks Neil
Edit : Next time I'll think a bit more before posting !! Just adder the looper.prepare() to my source code and now is sorted !! :sign0104: