Question

I am working on photo sharing related app in android. I want to implement a feature and I don't know how to implement it. The feature is when a long press occurred on a picture which is in my device gallery, it should be send to my app installed in the device. Before sending I wish to add a popup window or something like that to ask the user whether he wish to send the picture to app. How can I implement this feature?

Was it helpful?

Solution

What u want to desire can be done in some different way. In Gallery, Menu->Share-> Here u can show your app in the list of Sharing apps and u can receive image directly (Here you can show any popup or do whatever u want.)

For making your app visible in the list of sharing apps, you will need to apply intent-filter in your app. There are lots of related links and queries for performing above.

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

http://developer.android.com/training/sharing/receive.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top