Hello , i have this code:
The table estintori have 10 record preloaded with images (blob fields) set to null.
When i upload the image and click on Update Button of NavigatorBar then image are not saved in table of database.
Can someone help me ? Thanks
code:
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private DBN As NavigatorBar
Private imgPlanimetria As ImageView
Private Position As Int=0
Private btnUpload As Button
Private btnReset As Button
End Sub
'You can add more parameters here.
Public Sub Initialize As Object
Return Me
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("2")
If File.Exists(File.DirInternal,"planimetrie.db") = False Then
File.Copy(File.DirAssets,"planimetrie.db",File.DirInternal,"planimetrie.db")
End If
DBN.ConnectDB(File.DirInternal,"planimetrie.db",False)
DBN.AddLinkView(imgPlanimetria,"planimetria")
DBN.Query("SELECT * FROM estintori","ID")
DBN.Position=Position
DBN.FontAW=Typeface.FONTAWESOME
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub DBN_ValueChanged (Value As Int)
Position=Value
Log(Position)
End Sub
Sub ButtonUpdate_Click
DBN.UpdateChange
End Sub
Private Sub btnUpload_Click
Dim CC1 As ContentChooser
CC1.Initialize("CC1")
CC1.Show("image/*", "Seleziona Planimetria")
End Sub
Sub CC1_Result (Success As Boolean, Dir As String, FileName As String)
If Success=True Then
imgPlanimetria.Bitmap=LoadBitmap(Dir,FileName)
End If
End Sub
Private Sub btnReset_Click
imgPlanimetria.Bitmap=Null
End Sub
The table estintori have 10 record preloaded with images (blob fields) set to null.
When i upload the image and click on Update Button of NavigatorBar then image are not saved in table of database.
Can someone help me ? Thanks