Hello
In a panel'm creating images at runtime.
If I press on the image, leaving a message if you want to delete.
I want to delete with File.Delete but it does not work, it does not erase and returns me false.
I checked the directory and the name of the image and is correct.
The image to remove no matter who is in the internal memory, or on the SDCard ExSdCard, not delete.
I tried to remove the image (RemoveView), load another picture (b.Bitmap = LoadBitmapSample (Directory, NombreFiles.Get (0), 15% x 15%)), wait 200 milliseconds, but none of this has worked.
So do not do wrong, or if you have to add something in the Manifest.
Anyone can help me
thanks
Jesus
:sign0013: For my bad English
In a panel'm creating images at runtime.
If I press on the image, leaving a message if you want to delete.
I want to delete with File.Delete but it does not work, it does not erase and returns me false.
I checked the directory and the name of the image and is correct.
The image to remove no matter who is in the internal memory, or on the SDCard ExSdCard, not delete.
I tried to remove the image (RemoveView), load another picture (b.Bitmap = LoadBitmapSample (Directory, NombreFiles.Get (0), 15% x 15%)), wait 200 milliseconds, but none of this has worked.
So do not do wrong, or if you have to add something in the Manifest.
Anyone can help me
thanks
Jesus
:sign0013: For my bad English
B4X:
Sub Button_LongClick
Dim NombreImagen As String
Dim id As Int
Dim Resultado As Boolean
Dim b As ImageView
b = Sender
NombreImagen =b.Tag
id=Msgbox2("Quiere eliminar la imagen:" & CRLF & NombreImagen,"Eliminar", "Aceptar","Cancelar","",I_BGS.Bitmap)
If id = DialogResponse.Positive Then
' borrar imagen
'b.RemoveView
Dim Bitmap1 As Bitmap
Bitmap1.Initialize3(ImagenVacia.Bitmap)
'b.Bitmap=LoadBitmapSample(Directorio,NombreFiles.Get(0),15%x,15%y)
DoEvents
Sleep(200)
Resultado=File.Delete(Directorio,NombreImagen)
If Resultado = True Then
ToastMessageShow("Imagen eliminada" & CRLF & NombreImagen,True)
CargarImagenes
LeerImagenes
Else
ToastMessageShow("No se pudo eliminar la imagen:" & CRLF & NombreImagen,True)
End If
End If
End Sub