Search code examples
androidshareandroid-gallery

Customize Share Intent Android


i want to share images from gallery to my App i am using the following code to do that but i am not able to see myApp in Share option. i am using Android mobile version - 4.0.3

Mcode:

Manifest File:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.m.media"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <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_MULTIPLE"/>
               <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="image/*" />
        </intent-filter>
        </activity>

    </application>

</manifest>

i want my App to be in the Share options please tell me where i am going wrong and suggest me the correct solution.


Solution

  • Might be because you are only registering for the MULTIPLE intent.

    try adding this intent filter:

    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>