gallery

Select multiple images from Photo Gallery on Android using Intents

霸气de小男生 提交于 2019-11-26 13:09:47
问题 @See this https://stackoverflow.com/a/15029515/185022 I`m trying to select images from gallery, but i only found the way to select a single image. Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType(\"image/*\"); startActivityForResult(photoPickerIntent, 1); Is there a way to select multiple images? 回答1: Create a custom gallery same like: Android custom image gallery with checkbox in grid to select multiple 回答2: First of all you need to use putExtra with your

android : deleting an image

淺唱寂寞╮ 提交于 2019-11-26 13:05:36
I am deleting an image file from my application. I was doing new File(filename).delete (); This was actually deleting the file. But the image was still visible in the gallery. On search i found that we should use getContentResolver().delete(Uri.fromFile(file), null,null); to delete But here i am getting the exception: Unknown file URL. java.lang.IllegalArgumentException: Unknown URL file:///mnt/sdcard/DCIM/Camera/IMG_20120523_122612.jpg When i see with any file browser, this particular image is present. Please help me to fix this issue. Is there any other way to update gallery when image is

Android get image from gallery into ImageView

℡╲_俬逩灬. 提交于 2019-11-26 12:14:06
I'm trying to add a photo from galery to a ImageView but I get this error: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://media/external/images/media/1 }} to activity {hotMetter.pack/hotMetter.pack.GetPhoto}: java.lang.NullPointerException This is my code: Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent,"Select Picture"), SELECT_PICTURE); } Bitmap bitmap=null; public void onActivityResult(int requestCode, int

Using Intent.ACTION_PICK for specific path

夙愿已清 提交于 2019-11-26 11:27:56
问题 I am trying to use Android gallery to pick image. Launching gallery is easy for that purpose Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); photoPickerIntent.setType(\"image/*\"); startActivityForResult(photoPickerIntent, 1); However, I need to limit images that are shown in the gallery to specific path on device (i.e. to show images from single folder only). Is this possible to do and how? 回答1: Sorry, no this is not possible. Also you are using this Intent protocol wrong. As per

Android: Bitmaps loaded from gallery are rotated in ImageView

荒凉一梦 提交于 2019-11-26 11:04:02
When I load an image from the media gallery into a Bitmap, everything is working fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I always get a horizontal picture even though it appears vertical in the gallery. Why is that and how can I load it correctly? Have you looked at the EXIF data of the images? It may know the orientation of the camera when the picture was taken. So, as an example... First you need to create an ExifInterface: ExifInterface exif = new ExifInterface(filename); You can then grab the orientation of the image

How can I limit fling in Android gallery to just one item per fling?

假如想象 提交于 2019-11-26 10:56:37
问题 I have a gallery with several full screen images. I want to limit the fling gesture to only advance one image at a time (like the HTC Gallery app). What\'s the right/easiest way to achieve this? 回答1: Simply override the Gallery Widget's onFling() method and don't call the superclass onFling() method. This will make the gallery advance one item per swipe. 回答2: I had the same requirement and I just discovered that it will slide just one item per fling if I'll just return false. @Override public

How to stop scrolling in a Gallery Widget?

放肆的年华 提交于 2019-11-26 10:17:45
问题 I loaded some images into a gallery. Now I\'m able to scroll but once started scrolling the scrolling won\'t stop. I would like the gallery to just scroll to the next image and then stop until the user does the scroll gesture again. this is my code import android.widget.ImageView; import android.widget.Toast; import android.widget.AdapterView.OnItemClickListener; public class GalleryExample extends Activity { private Gallery gallery; @Override public void onCreate(Bundle savedInstanceState) {

Get list of photo galleries on Android

穿精又带淫゛_ 提交于 2019-11-26 05:57:42
问题 I\'m looking for: A list of the existing photo gallery names (hopefully their top thumbnail as well) The contents of the gallery (I can then load thumbnails and full size as needed) How would I go about getting a list of the \"Galleries\" (don\'t know if that\'s the proper term in android for the groupings of images visible in the Gallery app...) and their contents? I need access to the gallery in it\'s structure without using the existing gallery display (I\'m creating a totally new one, not

List all camera images in Android

ⅰ亾dé卋堺 提交于 2019-11-26 05:26:04
问题 How do you get a list of all camera images of an Android device? Is it through the MediaStore? How? 回答1: The Gallery app obtains camera images by using a content resolver over Images.Media.EXTERNAL_CONTENT_URI and filtering the results by Media.BUCKET_ID. The bucket identifier is determined with the following code: public static final String CAMERA_IMAGE_BUCKET_NAME = Environment.getExternalStorageDirectory().toString() + "/DCIM/Camera"; public static final String CAMERA_IMAGE_BUCKET_ID =

How can I make a horizontal ListView in Android? [duplicate]

瘦欲@ 提交于 2019-11-26 04:33:24
问题 Possible Duplicate: Horizontal ListView in Android? Like many things in Android, you wouldn\'t think this would be such a hard problem but ohhh, by golly, would you be wrong. And, like many things in Android, the API doesn\'t even provide a reasonably extensible starting point. I\'ll be damned if I\'m going to roll my own ListView, when all I want is to take the thing and turn it on its side. \\rant Okay, now that I\'m done fuming, let\'s talk about the problem itself. What I need is