The problem is that I have created in sqlite3 db, works well in the ListView shows me the records with the product name, but when I click on a record, I always display them last data record in the list when I click on the ListView.
I changed several times how to do the query but without success, keeps giving the data of the last record of the list of ListView.
I have relied on the example of jpvniekerk, but can not get the labels show the data for the record down.
http://www.b4x.com/forum/basic4andr...arebones-view-examples-sqlite.html#post120915
I hope you can help me out and guide me in what I'm doing wrong.
Greetings and thanks in advance
B4X:
Sub ListView1_ItemClick (Position As Int, Value As Object)
RemoveViews
Activity.LoadLayout("Product")
ItemSelected = Value
Label_Titulo.Text = Cur.GetString("Titulo")
Label_Fecha.Text = Cur.GetString("Fecha")
ImageView_Foto.Bitmap = LoadBitmap(File.DirAssets, Cur.GetString("Imagen")) ' Pruebas de imagen
Label_Producto.Text = Cur.GetString("Producto")
Label_Localidad.Text = Cur.GetString("Localidad")
End Sub
B4X:
Sub ListView1_ItemClick (Position As Int, Value As Object)
RemoveViews
Activity.LoadLayout("Product")
ItemSelected = Value
Cur = SQL1.ExecQuery("SELECT Titulo, Imagen, Localidad, Producto, Fecha, Ingredientes, Proceso FROM Countries")
For i = 0 To Cur.RowCount - 1
Cur.Position = i
Label_Titulo.Text = Cur.GetString("Titulo")
Label_Fecha.Text = Cur.GetString("Fecha")
ImageView_Foto.Bitmap = LoadBitmap(File.DirAssets, Cur.GetString("Imagen"))
Label_Producto.Text = Cur.GetString("Producto")
Label_Localidad.Text = Cur.GetString("Localidad")
Next
' Cur.Close
End Sub
http://www.b4x.com/forum/basic4andr...arebones-view-examples-sqlite.html#post120915
I hope you can help me out and guide me in what I'm doing wrong.
Greetings and thanks in advance