Rizwan Mumtaz
Rizwan Mumtaz

Reputation: 3955

Share Image to app using monodroid

How to Enable Share Image VIA my APP using Monodroid ?
I am using this piece of code in order to have a share to my app menu in android gallery application.

<application android:icon="@drawable/icon" android:label="TestRun!">
    <activity android:name=".ImageFromGallery">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
      </intent-filter>
    </activity>
  </application>

Effects :
Two Application icon appears on the menu.
A share button is added in gallery.
Can any one provide me with sample code ?
I Debugged the application ImageFromGallery activity never get called.

Upvotes: 1

Views: 351

Answers (2)

clifgray
clifgray

Reputation: 4419

The solution Bhavin posted is great if you're doing it on android but you need to add the two following lines about your class:

[Activity(Label = "Activity label", ScreenOrientation = ScreenOrientation.Portrait)]
[IntentFilter(new[]{Intent.ActionSend},Categories = new[]{Intent.CategoryDefault},DataMimeType = "image/*",Label = "Your application name")]

Then after that you can handle the image information however you'd like and the manner told on the link Bhavin posted is a solid way to do it.

Upvotes: 0

Bhavin
Bhavin

Reputation: 6010

This is the Perfect Example for You.

http://eggie5.com/8-hook-share-picture-via-menu-android

Upvotes: 1

Related Questions