android-gallery

How to get Multiple image uri from gallery with intent filter

好久不见. 提交于 2019-12-13 08:26:15
问题 I want to get multiple image URI using intent filter without implements a whole custom filechooser. To get the URI of a single image I use private void openImage() { try { Intent i = new Intent(Intent.ACTION_GET_CONTENT); i.setType("image/*"); startActivityForResult(i, FILE_REQ_CODE); } catch (RuntimeException e) { } } protected void onActivityResult(int requestCode, int resultCode, Intent intentData) { try { Uri tmp = intentData.getData(); filePath = getRealFilePathFromURI(tmp); super

Refresh MediaStore for Images & Videos

瘦欲@ 提交于 2019-12-13 07:51:16
问题 I moving and deleting lots of images and videos as per my requirement and now i am scan media by using Intent scanFileIntent = new Intent( Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, uri); sendBroadcast(scanFileIntent); all working fine but sometime freeze the screen, i think some issue in MediaScanner. And my second quetion is how to scan all media Store rether than scan perticuler File. Thanks in Advance!! 回答1: You should try this solution for amove and delete the image. Pass file directory path

how to save ViewPager Current image to sd card on button click

北城余情 提交于 2019-12-13 07:14:33
问题 i am working on a image swipe app in which i am swiping images on ViewPager and i want to save current showing image to sd card on button click. my code: SwipeActivity.java package com.td.gridview; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.view.View;

Try to get all image from sdcard to show in gallery view

我怕爱的太早我们不能终老 提交于 2019-12-13 05:34:41
问题 I'm trying to get all of the image that stored in sdcard to show in a gallery view by the code below. But when I use ImageFilter nothing shows up, just a blank screen without any error. Any suggestion? public class Galmix extends Activity { /** Called when the activity is first created. */ private Gallery g; private ImageView imv; private Uri[] mUrls; String[] mFiles=null; class ImageFilter implements FilenameFilter { public boolean accept(File dir, String name) { return (name.endsWith(".JPG"

Android MediaStore can't get inserted image data

被刻印的时光 ゝ 提交于 2019-12-13 05:14:02
问题 I have image editing app with image export function. Previously I tryed to export it directly by passing file path uri to ACTION_SEND intent. Something like: Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file)); shareIntent.setType("image/*"); shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); startActivity(Intent.createChooser(shareIntent, getString(R.string.export))); But not all apps can

How to get degree of rotation of image

为君一笑 提交于 2019-12-13 04:56:31
问题 I'm getting an image from gallery and display it in an imageView. Sometimes, image displays 90 degrees CCW. So, my question is: 1- is it possible to get angle of rotation of image? 2- is it possible to get angle by a face detection library? if yes, which library you suggest? any recommendation would be appreciated. Thanks. 回答1: Okay, I found a solution that I share it with you. public class ImageCorrection extends Activity { private final static String TAG = MainActivity.class.getSimpleName()

Order of images in Grid View in Android

此生再无相见时 提交于 2019-12-13 03:59:31
问题 I have an android application which has a grid view gallery in it. On this grid view I'm showing images in full screen when the user clicks on an image. It works quite well. But the problem is grid view shows the images correctly when they appear on the screen in the first time, but the order is changing randomly when user scrolls it down to see more images. Here is my code below for adapters and you can take a look to the pictures. public class GridGallery extends BaseAdapter { Context

Crop image on different devices

烂漫一生 提交于 2019-12-13 02:56:15
问题 I want to take a picture with the camera and crop it. This works great (with the second code) on newer devices with this code I found on the community wiki: Intent intent = new Intent("com.android.camera.action.CROP"); intent.setClassName("com.android.gallery", "com.android.camera.CropImage"); On some Android versions, including the newest, com.android.gallery doesn't exist anymore. You need to use this then: Intent intent = new Intent("com.android.camera.action.CROP"); intent.setClassName(

Gallery images taken on Samsung androids always in landscape even if taken in portrait

蹲街弑〆低调 提交于 2019-12-12 12:51:13
问题 Picking images from gallery with the following code: Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("*/*"); intent.addCategory(Intent.CATEGORY_OPENABLE); startActivityForResult(intent, PICK_FILE_RESULT_CODE); Getting result with the following code: @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_FILE_RESULT_CODE) { if (resultCode == RESULT_OK && data !=

Unable to load image when selected from the gallery on Android in phonegap

守給你的承諾、 提交于 2019-12-12 12:08:02
问题 I want to select image form android gallery and upload image to server. My code works properly for IOS apps. But not getting image from android phone. Inside android app getting show image url like this content://com.android.providers.media.documents/document/image%3A352 What should I do to get the right image extension from Android gallery? I am using Hybird App with Phonegap. document.addEventListener("deviceready", onDeviceReady, false); // device APIs are available // function