Hi,
this is my code:
tbl is a B4XTable added with the designer
The AddColumn works, but at tbl.Setdata the program crashes.
The log says the following:
at b4a.mylocation.sessions.access$000(sessions.java:17)
at b4a.mylocation.sessions$WaitForLayout.run(sessions.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (tracker) Create ***
** Service (tracker) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (sessions) Create, isFirst = true **
Error occurred on line: 676 (B4XTable)
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
at b4a.mylocation.b4xtable$ResumableSub_SetData.resume(b4xtable.java:459)
at b4a.mylocation.b4xtable._setdata(b4xtable.java:221)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at b4a.mylocation.sessions.afterFirstLayout(sessions.java:105)
at b4a.mylocation.sessions.access$000(sessions.java:17)
at b4a.mylocation.sessions$WaitForLayout.run(sessions.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
Why?
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
this is my code:
tbl is a B4XTable added with the designer
B4X:
tbl.AddColumn ("ID",tbl.COLUMN_TYPE_NUMBERS)
tbl.AddColumn ("Name",tbl.COLUMN_TYPE_TEXT)
tbl.AddColumn("Datum/Zeit",tbl.COLUMN_TYPE_TEXT)
Dim t1 As String = "a"
Dim t2 As String = "b"
Dim t3 As String = "c"
Dim l As List
l.Initialize
l.AddAll (Array As String (t1,t2,t3))
tbl.SetData (l)
tbl.Refresh
The AddColumn works, but at tbl.Setdata the program crashes.
The log says the following:
at b4a.mylocation.sessions.access$000(sessions.java:17)
at b4a.mylocation.sessions$WaitForLayout.run(sessions.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (tracker) Create ***
** Service (tracker) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (sessions) Create, isFirst = true **
Error occurred on line: 676 (B4XTable)
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Object[]
at b4a.mylocation.b4xtable$ResumableSub_SetData.resume(b4xtable.java:459)
at b4a.mylocation.b4xtable._setdata(b4xtable.java:221)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:146)
at b4a.mylocation.sessions.afterFirstLayout(sessions.java:105)
at b4a.mylocation.sessions.access$000(sessions.java:17)
at b4a.mylocation.sessions$WaitForLayout.run(sessions.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
Why?
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)