H
I am getting the following error with the subsequent code.
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.RuntimeException: java.lang.ClassNotFoundException: java.lang.string
at anywheresoftware.b4a.agraham.reflection.Reflection.classforname(Reflection.java:170)
at anywheresoftware.b4a.agraham.reflection.Reflection.RunMethod2(Reflection.java:815)
at b4a.example.main._lvevent_itemclick(main.java:356)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA$2.run(BA.java:285)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: java.lang.ClassNotFoundException: java.lang.string
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at anywheresoftware.b4a.agraham.reflection.Reflection.classforname(Reflection.java:167)
... 14 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.string" on path: DexPathList[[zip file "/data/app/b4a.example-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 18 more
Suppressed: java.lang.ClassNotFoundException: java.lang.string
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 19 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
java.lang.RuntimeException: java.lang.ClassNotFoundException: java.lang.string
Code follows.
Sub Process_Globals
End Sub
Sub Globals
Dimpn,lbAsList
DimlvAsListView
DimTAsTTS
End Sub
Sub Activity_Create(FirstTime AsBoolean)
lv.Initialize("lvEvent")
Activity.AddView (lv,0,0,100%x,100%y-50dip)
pn.Initialize
lb.Initialize
pn.Clear
lb.Clear
T.Initialize("TTSEvent")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed AsBoolean)
End Sub
Sub lvEvent_itemClick (pos AsInt,v AsObject)
Dim r AsReflector
r.Target = T
r.RunMethod2("SetEngineByPackageName",pn.Get(pos), "java.lang.string")
wait(5000)
End Sub
Sub wait(delay AsInt)
Dim now AsLong = DateTime.now
DoWhileDateTime.now<now+delay
Loop
End Sub
Sub TTSEvent_Ready (Success AsBoolean)
If Success Then
Dim r AsReflector
r.Target = t
Dim engines AsList = r.RunMethod("getEngines")
ForEach o AsObjectIn engines
r.Target = o
lv.AddSingleLine (r.GetField("label"))
pn.Add(r.GetField("name"))
Next
lv.Invalidate
EndIf
End Sub