Android Question Open file with external app

GaNdAlF89

Active Member
Licensed User
Longtime User
Hi guys!! In my app I have a pdf and a video files. My question is: how can I open these files with 3rd part app?
E.g. when I click on a button (that corresponds to the pdf file), I see a message like "Open with" and a list of installed apps which can open the pdf file. The same thing with the video file. Thanks for support!
 

Chandrashekhar

Member
Licensed User
Longtime User
B4X:
Dim i As Intent
    Dim u As Uri
    u.Parse(File.Combine(File.dirrootexternal,"/wr/"&"FILE NAME HERE"))
    i.Initialize(i.ACTION_SEND,"")
    i.SetType("image/png")
    i.PutExtra("android.intent.extra.STREAM",u)
    StartActivity(i)

This is how I "SHARE" in one of my application. Cheers
 
Upvote 0
Top