Hi Friends
I have fields of sqllite : id , name , age , note
and the name show in ListView in main activity
I want when i click in name in the listview jump to other activity to show all info in sql : name,age,note
Now i can show that in msgbox but i don't know how show that in other activity
How to do that ???
I have fields of sqllite : id , name , age , note
and the name show in ListView in main activity
I want when i click in name in the listview jump to other activity to show all info in sql : name,age,note
Now i can show that in msgbox but i don't know how show that in other activity
How to do that ???
B4X:
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: true
#IncludeTitle: false
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim sqldb As SQL
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Cur As Cursor
Private List_V1 As ListView
Private Button1 As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("a_main")
If File.Exists(File.DirDefaultExternal,"data1.db") = False Then
File.Copy(File.DirAssets,"data1.db",File.DirDefaultExternal,"data1.db")
End If
sqldb.Initialize(File.DirDefaultExternal,"data1.db",True)
Cur = sqldb.ExecQuery("SELECT * FROM t1")
For i = 0 To Cur.RowCount -1
Cur.Position = i
List_V1.AddSingleLine(Cur.GetString("name"))
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
StartActivity("a_page")
End Sub
Sub List_V1_ItemClick (Position As Int, Value As Object)
Cur = sqldb.ExecQuery("SELECT * FROM t1")
Cur.Position = Position
Msgbox("Name : "&Cur.GetString("name") & CRLF &"Age : " & Cur.GetString("age") & CRLF & "Note : " & Cur.GetString("note"),"")
End Sub