Android Question ( Solved ) Include App in Share List for WebPages

mangojack

Expert
Licensed User
Longtime User
Hi .. Is it possible to included your app in the Share Via list for web pages. I can successfully share images to my app, but can get nothing working for UrL's / webpages.

I added similar lines to the manifest .. but all fail.
B4X:
AddActivityText("main",
<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT"></category>
  <category android:name="android.intent.category.BROWSABLE"></category>
  <data android:scheme="http" />
</intent-filter> )

Many thanks
 

mangojack

Expert
Licensed User
Longtime User
Erel .. Initially I just want the URL and page title if possible which the user can categorize and store.
At this stage the user will not be on-sharing the URL.

Thanks
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Thanks Erel , that works . But now how does the app get/retrieve the url . I have tried this but again fail

B4X:
Dim In As JavaObject = Activity.GetStartingIntent
Log(In.RunMethod("getParcelableExtra", Array("android.intent.extra.STREAM")))

Thanks
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
"Null"
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
EDIT: sorry Erel .. misread your last question. the log output of starting intent was ...

(Intent) Intent { act=android.intent.action.SEND typ=text/plain flg=0x1 cmp=com.testapp.testcode/.main (has clip) (has extras) }

In the Test app I have B4A forum page displayed in Opera browser. Choosing my app in the Share list starts the app OK. Just not able to log any 'Extras'
 
Last edited:
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Using the following I am able to get a parsable string ..
B4X:
Log(Activity.GetStartingIntent.ExtrasToString)

results in ....Bundle[{android.intent.extra.SUBJECT=Questions | B4A (Android) / B4i (iOS) / B4J Developers Community, android.intent.extra.TEXT=https://www.b4x.com/android/forum/forums/questions.26/}]

Many thanks Erel ...


HasExtra .. ! Using the following to get 'SUBJECT' and 'TEXT' lines from extras string
B4X:
Activity.GetStartingIntent.GetExtra("android.intent.extra.SUBJECT")
Activity.GetStartingIntent.GetExtra("android.intent.extra.TEXT")
 
Last edited:
Upvote 0
Top