I have a query with single result. I need to get some data from two or three columns and assign the result to two or three variables. The only way what I found is to use cursor. But cursor is used rather for queries with many rows in result.
B4X:
Cursor1= Main.SQL.ExecQuery("select column1, column2, column3 from table")
Cursor1.Position=0
For i=0 To Cursor1.RowCount-1
Cursor1.Position=i
var1 = Cursor1.GetString("column1")
var2 = Cursor1.GetString("column2")
var3 = Cursor1.GetString("column3")
Next
Cursor1.Close
Don't use Cursor. Use ResultSet. Make sure that it is a local variable.
The fact that SQL is in the Main activity means that you are doing something wrong. It should be in the starter service, or better switch to B4XPages.