android-gallery

How can I display a specific folder in Android Gallery3D (cooliris)?

╄→гoц情女王★ 提交于 2019-11-29 02:37:23
I'm using Gallery3D (froyo-stable) I'm trying to make a little app that displays only images from a specific folder in a gallery view. Uri targetUri = Media.EXTERNAL_CONTENT_URI; String folderPath = Environment.getExternalStorageDirectory().toString() + "/DCIM/"; int folderBucketId = folderPath.toLowerCase().hashCode(); targetUri = targetUri.buildUpon().appendQueryParameter("bucketId", String.valueOf(folderBucketId)).build(); In initializeDataSource() // Creating the DataSource objects. final LocalDataSource localDataSource = new LocalDataSource(Gallery.this, targetUri.toString(), false); But

android- open gallery and choose image and video

▼魔方 西西 提交于 2019-11-28 21:34:35
In my project I want to open a gallery on a button click and should be able to pick image or video to get path of them. Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, RESULT_LOAD_IMAGE); From above code i am able to open gallery but in this case i am only able to choose image. So, please help me in choosing video also. Thanks in advance. Jc Miñarro You can use the next snippet: Intent mediaChooser = new Intent(Intent.ACTION_GET_CONTENT); //comma-separated MIME types mediaChooser.setType("video/*, image/*");

Select image from gallery and show in imageview

别等时光非礼了梦想. 提交于 2019-11-28 14:44:56
I need Open my gallery in mobile phone and select one picture which opened in imageview on activity.. nothing hard.. but I have code and thise code in simulator (genymotion) run perfect.. but on real phone Xiaomi Mi4 nothing. Open gallery select item and nothing. I haven't have more phones :( I try download some examples with this theme and every it's the same.. galery open when I select item app doing nothing. Have you some project with select image from gallery and show in imageview? if yes please share your code and upload me somewhere .apk for try, because I .. :( :'( my gradle apply

Getting Image from ImageView

若如初见. 提交于 2019-11-28 07:25:05
I have a gallery that shows an array of images, when clicked they are displayed in an imageview. I want to be able to SHARE the image that is currently being displayed in an intent chooser. I can't figure out how to select the current image. Gallery code: public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView = new ImageView(mContext); imageView.setImageResource(mImageIds[position]); imageView.setLayoutParams(new Gallery.LayoutParams(150, 120)); imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setBackgroundResource(mGalleryItemBackground);

Android get Gallery image Uri path

左心房为你撑大大i 提交于 2019-11-28 07:12:53
In an Activity, I can choose an image from the Gallery, and I need its Uri path (in the log, the Uri path for my test image is /content:/media/external/images/media/1 ). I'm getting this error though: 08-04 02:14:21.912: DEBUG/PHOTOUPLOADER(576): java.io.FileNotFoundException: /content:/media/external/images/media/1 (No such file or directory) 08-04 02:14:32.124: WARN/System.err(576): java.io.FileNotFoundException: /content:/media/external/images/media/1 (No such file or directory) Is this the correct format of a file path? Or should I make it to be something like sdcard\...\image.png ? Allan

ScrollView inside Gallery, both scrolling independently

蹲街弑〆低调 提交于 2019-11-28 07:04:50
I have a Gallery with an adapter which supplies it ScrollViews as its child views. I need to make sure that the touch events are handled correctly and as expected: When the user scrolls horizontally, the gallery scrolls horizontally. When the user scrolls vertically, the scroll view scrolls vertically. Both scrolls should never happen on the same gesture (the user must lift their finger to scroll the other view). Everything must scroll smoothly. Without overriding any methods, the scroll view is the only thing that scrolls - the gallery never scrolls. So I understand I need to use

File not added to gallery android

邮差的信 提交于 2019-11-28 02:06:53
问题 This app i am making is taking pictures and saving it to sdcard but the images are not being shown in gallery...Is there something wrong with my code public void takepicture(View view){ try{ String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { //To store public files File directory=new File(Environment.getExternalStorageDirectory() , "Myapp Pictures"); if(!directory.exists()) directory.mkdir(); // Create an image file name String timeStamp = new

Android READ_EXTERNAL_STORAGE permission not working

最后都变了- 提交于 2019-11-28 01:50:36
I'm trying to create a simple app that can get an image from the Gallery app and display it on an imageButton. I'm testing with API 21 on a phone running Android 5.0.1. Unfortunately, no matter what I try I keep getting a security error - even when I specify the permissions. My code for getting retrieving the image is: @Override protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent){ super.onActivityResult(requestCode, resultCode, imageReturnedIntent); switch(requestCode){ case PICK_IMAGE_REQUEST: if(resultCode == RESULT_OK && imageReturnedIntent != null &

Select Multiple Images Using GalleryView

我的梦境 提交于 2019-11-28 00:42:30
问题 I was just wondering if Android had built in code so that I could select multiple images in a gallery-view and then have those images exported as filenames in a string array(ex /sdcard/~f1.jpg, /sdcard/~f2.jpg,...). Again any help is appreciated! Just to let you guys know, the gallery I'm using works fine (for one image) -- as in it exports the filename correctly. Just need to know if there is an easy way to select multiples and export them. Thanks again! 回答1: The gallery widget doesn't

How can I stop MediaStore.ACTION_IMAGE_CAPTURE duplicating pictures

百般思念 提交于 2019-11-27 23:05:48
问题 I am using the following code to take a picture: private static final int TAKE_PHOTO_CODE = 1; final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tFile)); startActivityForResult(intent, TAKE_PHOTO_CODE); This code works fine however I am getting a copy of every picture I take automatically appearing in the "Camera Shots" gallery as well as where I want the picture to go. How do I stop it automatically copying my picture?