Search code examples
androidandroid-intentshareintentfilter

Make my android app appear in the share list


How do i make my application appear here? :

enter image description here

some informations led me to put this code on my Manifest (See code below) but it doesn't work. The thing is if i want to share an image from my gallery, i want to see my app on the list of app on the share list. Any pointers? please help.

<activity
        android:name="com.my.package.MyIntent"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.ALL_APPS" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:mimeType="text/plain" />
        </intent-filter>
    </activity>

Thank you :)


Solution

  • Try this way

           <activity
            android:name="yourActivity"
            android:icon="@drawable/ic_launcher"
            android:label="test">
            <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>
    
            <intent-filter>
                <action android:name="android.intent.action.SEND" />
    
                <category android:name="android.intent.category.DEFAULT" />
    
                <data android:mimeType="text/plain" />
            </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>
    

    For more information go to Receiving Simple Data from Other Apps and Sending Simple Data to Other Apps