Wednesday, December 22, 2010

[android-developers] How do i multi select images in the Gallery and send there URL to my activity?

hi
In the gallery I have added my Item to the share menu. But i can only
get one image and making my Activity start. This code give me the URL
for one image. Is it possible to set up the Gallery or the share menu
so that user can select one or many pictures?

if (Intent.ACTION_SEND.equals(action))
{ if extras.containsKey(Intent.EXTRA_STREAM))
{ Uri uri = (Uri)extras.getParcelable(Intent.EXTRA_STREAM); //path
to image
Toast toast = Toast.makeText(this, "path: "+
getRealPathFromURI(uri),
Toast.LENGTH_SHORT); toast.show();
return;
} else if
(extras.containsKey(Intent.EXTRA_TEXT)) {
}

} public String getRealPathFromURI(Uri contentUri) { String[] proj =
{
MediaStore.Images.Media.DATA }; Cursor cursor =
managedQuery(contentUri,
proj, null, null, null); int column_index =
cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst(); return cursor.getString(column_index);
}

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

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate