intent i.ACTION_VIEW problem.

grant1842

Active Member
Licensed User
Longtime User
I am opening an .jpg with an i.ACTION_VIEW intent.

It opens in gallery , but there is no menu options(share,Facebook,Gogle+) just the picicture .


How can I get all the menu options of the gallery to work.

My goal is to load the image.jpg in the default gallery and be able to use all the features of the gallery(share, delete, crop, etc.

B4X:
'Thanks NJdude :)
Sub Camera1_PictureTaken (Data() As Byte)
    camera1.StartPreview
   
    Dim out As OutputStream
    out = File.OpenOutput(File.DirRootExternal, "Image.jpg", False)
    out.WriteBytes(Data, 0, Data.Length)
   out.Close
    
'   ToastMessageShow("Image saved: " & File.Combine(File.DirRootExternal, "Image.jpg"), True)
   Dim su As StringUtils
   Dim Filepath As String
   Filepath = File.Combine(File.DirRootExternal, "Image.jpg")
   Dim i As Intent
   'i.Initialize(i.ACTION_VIEW, "file://" & su.EncodeUrl(Filepath, "UTF8"))
   i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "Image.jpg"))
   
   i.SetType("image/*")
   StartActivity(i)
    Log("error:"&I)
End Sub
 

grant1842

Active Member
Licensed User
Longtime User
THanks Erel.
This will help to share.

Is there no way to Programally open up a .jpg file in the default gallery and have all the options for the image as if you were to take the picture with the default camara software on the phone?

Thanks for your input.
 
Upvote 0

grant1842

Active Member
Licensed User
Longtime User
I just want to open a jpg image in the default android gallery app so you can use Delete, Crop, Share etc.

B4X:
Dim Filepath As String
   Filepath = File.Combine(File.DirRootExternal, "Image.jpg")
   Dim i As Intent
   i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirRootExternal, "Image.jpg"))
   i.SetType("image/*")
   StartActivity(i)
    Log("error:"&I)
Seems like there should be a way to do this. Is the intent method I am using seem correct .
 
Upvote 0

grant1842

Active Member
Licensed User
Longtime User
When I open the same image using the Astro file manager it asks to open the image using the same gallery app and it gives me the Set As and Share and delete options. When I do it using that code, and choose the same gallery, it lacks the delete option.
 
Upvote 0
Top