Can somebody help me how to fix this? I want display the text value on the other module but there is no display. Here is the code:
- BJavaBooks.bas
-BTitles.bas
If I will click the listview, the data on the global variables will be passed on the labels of BTitles.bas. How can I make it? thanks
- BJavaBooks.bas
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim sql1 As SQL
Dim cursor1 As Cursor
Dim x1,x2,x3 As String
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
Dim idvalue As String
Dim countIt As Int
Dim ID As String
idvalue = Value
'countIt = idvalue.IndexOf("-") 'find location of sperator
'idvalue = idvalue.SubString2(0,countIt) 'find first part of label text
ID = idvalue
cursor1 = sql1.ExecQuery("SELECT * FROM main where ID = '" & ID & "' ")
For i = 0 To cursor1.RowCount - 1
cursor1.Position = i
x1 =cursor1.getString("BType")
x2=cursor1.getString("BTitle")
x3=cursor1.getString("BAuthor")
StartActivity("BTitles")
Next
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("bookstitle")
TTS.InitializeTTs("tts", "English")
If File.Exists(File.DirInternal,"Books1.db") = False Then
File.Copy(File.DirAssets,"Books1.db",File.DirInternal,"Books1.db")
End If
If sql1.IsInitialized = False Then
sql1.Initialize(File.DirInternal, "Books1.db", False)
End If
lblType.Text = BJavaBooks.x1
lblTitle.Text = BJavaBooks.x2
lblAuthor.Text = BJavaBooks.x3
End Sub
Last edited: