Android Question Having problems with widgets

NeoTechni

Well-Known Member
Licensed User
Longtime User
B4X:
Sub Service_Create
   'Set the widget to update every 10 minutes.
   Log("l1.bal exists: " & File.Exists(File.DirAssets, "l1.bal"))
   rv = ConfigureHomeWidget("l1", "rv", 10, "SCIFI UI WIDGET",True)'WHY IS THIS FAILING?!!!
   mAppWidgetIdList.Initialize
   PE.Initialize("PE")
End Sub

Results in:

l1.bal exists: true
Error occurred on line: 195 (Widgets)
java.io.FileNotFoundException: l1.bal
at android.content.res.AssetManager.openAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:313)
at android.content.res.AssetManager.open(AssetManager.java:287)
at anywheresoftware.b4a.objects.RemoteViewsWrapper.createRemoteViews(RemoteViewsWrapper.java:39)
at anywheresoftware.b4a.debug.RDebugUtils.createRemoteView(RDebugUtils.java:31)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:163)
at com.omnicorp.scifiui.widgets.onCreate(widgets.java:55)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2877)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

But only in debug mode...
This is the same code I used in another app, and was the same bal file. I went into the designer and removed all the files out of it, thinking a missing one triggered the error but even without any files I get the error.

I wrapped it in a try/catch, and now I get this:

java.lang.RuntimeException: Unable to create service com.omnicorp.scifiui.stimer: java.lang.RuntimeException: java.net.SocketException: Socket closed
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2887)
at android.app.ActivityThread.-wrap4(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1427)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.RuntimeException: java.net.SocketException: Socket closed
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:168)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:101)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:88)
at com.omnicorp.scifiui.stimer.onCreate(stimer.java:33)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2877)
... 8 more
Caused by: java.net.SocketException: Socket closed
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:189)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
at libcore.io.IoBridge.recvfrom(IoBridge.java:549)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:481)
at java.net.PlainSocketImpl.-wrap0(PlainSocketImpl.java)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at java.io.InputStream.read(InputStream.java:162)
at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:149)
at java.io.BufferedInputStream.read(BufferedInputStream.java:295)
at libcore.io.Streams.readFully(Streams.java:81)
at java.io.DataInputStream.readInt(DataInputStream.java:103)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:140)

;_;
 
Top