Setting my app as a sharing target (Xamarin)

前端 未结 2 414
醉梦人生
醉梦人生 2021-01-27 13:25

I\'m looking for a way to enable my users to send images to my app via sharing (On android).

My main goal right now is to get my app on the \"share to\" tab when pressin

相关标签:
2条回答
  • 2021-01-27 13:29

    I have found my answer using a android studio instead of xamarin, as it was giving me a lot of problems. If you have the same problem yourself, you should follow Arvindraja answer, please do not that his answer will only make your app appear in the share menu but the data you will share to it will not be saved anywhere, for that you will need additional code.

    0 讨论(0)
  • 2021-01-27 13:48

    To have your project in share list you need to manipulate your menifest file

     <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name" 
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true" 
        android:theme="@style/AppTheme">
    
    <activity android:name=".MyActivity" >
        <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>
    
        </application>  
    

    & for more information on this you can visit this & this

    In those links you might get things in more precise way. Good luck.

    0 讨论(0)
提交回复
热议问题