How to add my Android application to the send list?

I am implementing an application.
It can upload photos to my own server.
I want my application to be listed in the send list when the code below is implemented:

Intent share = new Intent(Intent.ACTION_SEND); share.setType("image/jpeg"); share.putExtra(Intent.EXTRA_STREAM, Uri.parse(FilePath)); startActivity(Intent.createChooser(share, "Share Image")); 

How can i do this?

+4
source share
1 answer

You need to add the following to the manifest.

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

Your manifest should look something like this.

 <application android:name="MyApplication" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> <activity android:name="com.example.arcasample.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"></action> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/jpeg" /> </intent-filter> </activity> </application> 
+8
source

All Articles