Hi,
My app had a activty that has a panel with camera inside. User click in a button in take picture. I want to show that picture inside the same panel. (turn off camera and shows the picture). It's not working.
If I leave my app like pressing home button and the back to the app the picture shows.
Below the code ....
My app had a activty that has a panel with camera inside. User click in a button in take picture. I want to show that picture inside the same panel. (turn off camera and shows the picture). It's not working.
If I leave my app like pressing home button and the back to the app the picture shows.
Below the code ....
B4X:
Sub Camera1_PictureTaken (Data() As Byte)
Dim filename As String = maxIDTabela("ODS_REGISTROS") & ".jpg"
Dim dir As String = File.DirRootExternal & "/AP-Memoria/Fotos"
camEx.SavePictureToFile(Data, dir, filename)
'camEx.StartPreview 'restart preview
camEx.CloseNow
'send a broadcast intent to the media scanner to force it to scan the saved file.
Dim Phone As Phone
Dim i As Intent
i.Initialize("android.intent.action.MEDIA_SCANNER_SCAN_FILE", _
"file://" & File.Combine(dir, filename))
Phone.SendBroadcastIntent(i)
ToastMessageShow("Picture saved." & CRLF & "File size: " & File.Size(dir, filename), True)
Dim bd As BitmapDrawable
bd.Initialize(LoadBitmap(Main.DBFileDir & "/Fotos",maxIDTabela("ODS_REGISTROS") & ".jpg"))
bd.Gravity = Gravity.Fill
pnlFoto.Background = bd
lblTirarFoto.Text = "Nova Foto"
End Sub