Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the data from "share picture via" dialog on Android?

I've added the intent-filter. And when I tap "share" in the Gallery, it will launch my activity.

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

But I don't know how to get the correct data from the current intent. Any helps?

EDIT: Sorry, missing "picture" in the question

like image 723
shiami Avatar asked Nov 15 '10 07:11

shiami


People also ask

How to share photos on your Android phone?

Once you tap on a photo, you will see Share, Edit, Info and Delete icons appearing at the bottom of the screen. 4. Tap on the Share icon to launch the Share via popup menu on your Android Phone.

How to send photos from Android phone to Facebook?

1 Open the Photos or Gallery app on your Android Phone or tablet. 2 Tap on the Photo that you would like to send or share with others. 3 Once you tap on a photo, you will see Share, Edit, Info and Delete icons appearing at the bottom of the screen. 4 Tap on the Share icon to launch the Share via popup menu on your Android Phone. ... More items...

How do I send multiple pictures in an email on Android?

Type in your Message, add recipient’s email address and send your email with the picture attached. The steps for sharing multiple photos on Android Phone are a bit different, but you will still get the same Share Via option, which makes it so easy to share images using email, text and messaging apps.

What is dialog in Android?

A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout. A dialog with a pre-defined UI that allows the user to select a date or time. Caution: Android includes another dialog class called ProgressDialog that shows a dialog with a progress bar.


1 Answers

I found the answer.

Uri imageUri = (Uri) getIntent().getExtras().get(Intent.EXTRA_STREAM);
like image 182
shiami Avatar answered Sep 28 '22 07:09

shiami