B4J Question [BANano] How to use a normal class inside Background Worker

Mashiane

Expert
Licensed User
Longtime User
Hi

I have defined a class that uses BANano.Await internally and have defined it in the worker as I intend using it there.. Here is the worker code..

B4X:
Sub Class_Globals
    Private BANano As BANano 'ignore
    Private eSqlite As SithasoSQLiteEmbedded
End Sub

I Intend to call a sub that will use the class

B4X:
Sub OpenSQLite(fileName As String)
    Log($"OpenSQLite:${fileName}"$)
    eSqlite.Initialize(Me, "sqlite", fileName)
    BANano.Await(eSqlite.OpenDatabase)
End Sub

I am however getting this error on the console.

B4X:
Uncaught SyntaxError: Identifier 'sleep' has already been declared (at bananocorebw.js:1:1)
    at sqlite3x.js:3:1
    at sqlite3x.js:3:76

I have noted in my scripts there are 2 files that have been generated

1698009689941.png


Please advise.
 
Top