Android Sharing Intent
Solution 1:
I don't how this would be done using Titanium, but in the conventional way (using Eclipse), this is how I do it in one of my apps:
CODE: In your manifest XML file, add the tag as shown below. This is to be done for an Activity
that will handle data shared by the user. For example, if my Activity
is named Composer
, then the structure would be:
<activityandroid:name=".Composer"android:exported="true"android:windowSoftInputMode="stateHidden|adjustResize" ><intent-filter><actionandroid:name="android.intent.action.SEND" /><categoryandroid:name="android.intent.category.DEFAULT" /><dataandroid:mimeType="text/plain" /><dataandroid:mimeType="image/jpeg" /><dataandroid:mimeType="image/png" /></intent-filter></activity>
EXPLANATION OF THE CODE:
The key here are the data
tags nested under the <intent-filter>
. If I want my app listed when the user shares web links, the "text/plain"
comes into play. When I want my app to handle Images shared from, say, the Gallery app, the "image/jpeg"
and the "image/png"
entries come into play (depending on the image file extension). As, however, indicated by the attached screenshot in the OP, if you only need to get your app listed in browsers when sharing web links, then the <data android:mimeType="text/plain" />
will do it for you.
Again, I do not know if the code above works as-is in Titanium. I have never used it nor have read up on it. You may have to tweak it a bit if there is a difference in how this is done when using Titanium.
Post a Comment for "Android Sharing Intent"