I don't get any error...
Please post the full error message
I changed from B4XLibrary to a project with a standard class (so I can locate the error).
This is the full error text:
Copying updated assets files (20)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
Error occurred on line: 753 (clsPreferencesDialog)
java.lang.ClassCastException: java.lang.String cannot be cast to b4a.example.clspreferencesdialog$_b4xprefitem
at b4a.example.clspreferencesdialog._scrolltoitemwitherror(clspreferencesdialog.java:1016)
at b4a.example.b4xmainpage._prefdialog_isvalid(b4xmainpage.java:553)
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:157)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1114)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069)
at b4a.example.clspreferencesdialog._commitchanges(clspreferencesdialog.java:1681)
at b4a.example.clspreferencesdialog$ResumableSub_ShowDialog.resume(clspreferencesdialog.java:735)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resumeAsUserSub(DebugResumableSub.java:48)
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:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$DelegatableResumableSub.resume(DebugResumableSub.java:43)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:150)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.keywords.Common$15.run(Common.java:1804)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8918)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
** Activity (main) Pause event (activity is not paused). **
And this is where the error occurs:
'Scrolls to the item and shows a "shake" animation.
Public Sub ScrollToItemWithError (key As String)
For i = 0 To CustomListView1.Size - 1
Dim Item As CLVItem = CustomListView1.GetRawListItem(i)
Dim PrefItem As B4XPrefItem = Item.Value '<<<< error occurs here
If PrefItem.Key = key Then
GoToItem(i)
Return
End If
Next
End Sub
RBS