B4J Question Cannot use ExecuteList from DBUtils.

LWGShane

Well-Known Member
Licensed User
Longtime User
I'm trying to use ExecuteList from DBUtils, but keep getting this error:

B4X:
java.lang.ClassCastException: javafx.scene.control.ListView cannot be cast to java.util.List

This is my code:

B4X:
Sub ShowRecents
    Dim Recents As SQL
    Recents.InitializeSQLite(DBLocal, "recent-projs.db", False)
    Dim QueryRecents As String = "SELECT Name FROM Recents"
    DBUtils.ExecuteList(Recents, QueryRecents, Null, 0, RecentProjectsList)
End Sub

(I'm working on a B4X "Launcher". Have everything working except the recent projects code.)

The Database is attached.
 

Attachments

  • recent-projs.zip
    511 bytes · Views: 163

Roycefer

Well-Known Member
Licensed User
Longtime User
The error message tells you what the problem is. You're trying to use a ListView somewhere that requires a List. My guess is that you should be using ListView.Items instead of the ListView.
 
Upvote 0

LWGShane

Well-Known Member
Licensed User
Longtime User
The error message tells you what the problem is. You're trying to use a ListView somewhere that requires a List. My guess is that you should be using ListView.Items instead of the ListView.

I didn't even think that List didn't mean "ListView". Thanks!
 
Upvote 0
Top