A andrewj Active Member Licensed User Longtime User Mar 8, 2014 #1 Hi, Does anyone know the correct form of intent to use to share a URL rather than a file? Thanks Andrew
Hi, Does anyone know the correct form of intent to use to share a URL rather than a file? Thanks Andrew
Erel B4X founder Staff member Licensed User Longtime User Mar 9, 2014 #2 Sharing a url is similar to sharing text: Code: Copy Dim i As Intent i.Initialize(i.ACTION_SEND, "") i.SetType("text/plain") i.PutExtra("android.intent.extra.TEXT", "http://www.b4x.com") i.PutExtra("android.intent.extra.SUBJECT", "This is the subject") StartActivity(i) Upvote 0
Sharing a url is similar to sharing text: Code: Copy Dim i As Intent i.Initialize(i.ACTION_SEND, "") i.SetType("text/plain") i.PutExtra("android.intent.extra.TEXT", "http://www.b4x.com") i.PutExtra("android.intent.extra.SUBJECT", "This is the subject") StartActivity(i)
A andrewj Active Member Licensed User Longtime User Mar 9, 2014 #3 Thanks Erel, that works well. Oddly though, the list includes non-browser apps which can consume a URL, but not the other browsers themselves. Does this require a slightly different intent, for an "Open in other browser" option? Andrew Upvote 0
Thanks Erel, that works well. Oddly though, the list includes non-browser apps which can consume a URL, but not the other browsers themselves. Does this require a slightly different intent, for an "Open in other browser" option? Andrew
Erel B4X founder Staff member Licensed User Longtime User Mar 10, 2014 #4 Change the action to VIEW if you want to open it in a browser. Upvote 0
A andrewj Active Member Licensed User Longtime User Mar 10, 2014 #5 Hi Erel, I tried changing ACTION_SEND to ACTION_VIEW, but it doesn't work, I get a very odd selection of target apps, no browsers. Does the type need to change as well? PS - V3.5 seems to be working well. Thanks Andrew Upvote 0
Hi Erel, I tried changing ACTION_SEND to ACTION_VIEW, but it doesn't work, I get a very odd selection of target apps, no browsers. Does the type need to change as well? PS - V3.5 seems to be working well. Thanks Andrew
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2014 #6 The PhoneIntents.OpenBrowser (Phone library). Upvote 0