My Android application uses the navigation component to navigate between fragments.
And the project only has a single Activity and all the others are fragments.
My application is a social media application. I want to share an image from my phone gallery with my application. When a user clicks the share button on the gallery, my application wants to show in the sharing dialogue.
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
I have used this intent filter on my main activity, and then the share dialogue displays my app.
But my requirement is, I want to get that image on my fragment. How to use this intent filter on my fragment.
Can I use the deep-link for that? but what value will give on the uri section?.
<deepLink
app:uri="android.intent.category.DEFAULT"
app:action="android.intent.action.SEND"
app:mimeType="image/*"
/>
I tried this. but not working.
In short, I want to receive the data (image) in my fragment. How can I achieve this using the Navigation component?