Sub Activity_PermissionResult (Permission As String, Result As Boolean)
Log(Permission & ": " & Result)
End Sub
Sub enviar_imagen
If rp.Check(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)=False Then
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Return
End If
cc.Initialize("cc")
cc.Show("image/*", "Choose image")
End Sub
Sub cc_Result (Success As Boolean, Dir As String, FileName As String)
Log("CCresult success:" & Success & " dir:" & Dir & " filename:" & FileName)
If FileName.Contains("content://com.google.android.apps.photos") Or FileName.Contains("content://com.google.android.apps.docs.storage") Then
Msgbox(t.t("No puede usar Fotos desde Google Idrive"),t.t("Info"))
Return
End If
File.Delete(codigo.DirDefaultExternal,"foto.jpg")
If codigo.Nz(FileName,"")="" Then Return
If Success=True Then
Dim normalizedFile As String = codigo.GetPathFromContentResult(FileName)
If normalizedFile= "" Then
Msgbox(t.t("Imagen no compatible"),t.t("Info"))
Return
End If
If normalizedFile.Contains("http") Then
'carga imagen
job5.Initialize(Me)
job5.jobbitmap(normalizedFile)
Return
Else
If codigo.copytryimage(Dir, FileName, codigo.DirDefaultExternal,"foto.jpg") Then
If File.Exists(codigo.DirDefaultExternal,"foto.jpg") Then
cropimage.callback=Me
'cropimage.bmp = LoadBitmap(codigo.DirDefaultExternal,"foto.jpg")
StartActivity(cropimage)
Return
End If
End If
If codigo.copytryimage("", normalizedFile, codigo.DirDefaultExternal,"foto.jpg") Then
If File.Exists(codigo.DirDefaultExternal,"foto.jpg") Then
cropimage.callback=Me
'cropimage.bmp = LoadBitmap(codigo.DirDefaultExternal,"foto.jpg")
StartActivity(cropimage)
Return
End If
End If
End If
End If
End Sub