android-gallery

problem in opening photoviewer for displaying all the images stored in a particular folder in android

天涯浪子 提交于 2019-12-11 23:42:21
问题 I have one activity(MyActivity), in which I have a grid view. Also I have the "add existing photo from gallery " button. When we click on this button it will open the gallery viewer application and after selecting any photo in gallery it will update the gridview in MyActivity. Also I am storing the selected photos in the myimage folder in sdcard. I want that if I will select any particular cell in grid view it will open the photoviewer to display all the images present in that folder (myimage

not able to downsize the image

北城余情 提交于 2019-12-11 23:22:14
问题 I have made an app in which user select image from gallery.But when user select an image that is taken from camera i get "Memory OutOFBound error".I tried downsizing it but no sucess.Please help me. protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult (requestCode, resultCode, data); if (requestCode == 1 && resultCode == RESULT_OK && null != data) { selectedImage = data.getData (); try { decodeUri (getApplicationContext (),selectedImage,100);

Sharing files or content with 3rd party activities

寵の児 提交于 2019-12-11 11:52:46
问题 I have a simple question but can't seem to find the answer anywhere I look online. I have an activity A that downloads files from the internet and puts them to a local folder obtained by getApplicationContext().getFilesDir().getPath() which points to: "/data/data/com.myapp.android/files" Now when the user selects a file I want to show its content and for that I do the following: File file = new File(filePath); Uri uri = Uri.fromFile(file); MimeTypeMap mime = MimeTypeMap.getSingleton(); String

text customization for Infinite Scrolling Gallery

不想你离开。 提交于 2019-12-11 11:07:42
问题 I have infinite gallery based on this example : http://blog.blundell-apps.com/infinite-scrolling-gallery/, every thing run ok : exactly i want to applied text to each image and able to customize text too as shown down image ,and each image has diffrenet text than others , but still not succeed to do it with infinite gallery I tried with following code but it gave me FORCE CLOSE when running the app , ( MAYBE THERE IS WRONG CODES I WROTE , BUT IM STILL LEARNING JAVA AND BEGINER IN ANDROID

how to get all the images from in built gallery to my application…?

半城伤御伤魂 提交于 2019-12-11 10:48:38
问题 I want to start in built gallery activity for multiple selection. I have tried this, but it selects only one image. Thanks in advance..! 回答1: You have to create your own list of images having checkboxes to select multiple image files. Use the below code to get the cursor for gallery and create a list adapter which will iterate over cursor and will give image. This image can be used to show in list view with checkboxes. String[] projection = { MediaStore.Images.Media.DATA }; Cursor cursor =

I can't save my bitmap to the Gallery in Android?

时间秒杀一切 提交于 2019-12-11 07:16:19
问题 I'm trying to save my edited image into Gallery from where user can access it. I have used "Add the photo to the Gallery" from reference: https://developer.android.com/training/camera/photobasics.html Here is my Code: String mCurrentPhotoPath; public void startSave() { FileOutputStream fileOutputStream = null; File new_file = null; try { new_file = createImageFile(); fileOutputStream = new FileOutputStream(new_file); imageView.setDrawingCacheEnabled(true); Bitmap bitmap = Bitmap.createBitmap

Image content can not read during zoom

﹥>﹥吖頭↗ 提交于 2019-12-11 05:50:17
问题 When i zoom image by pinch , i can not read the content of image . This is my code:- if(!(it.isEmpty() )) { Collections.sort(it); for(int i=0; i<it.size();i++) { ImageViewTouch imageView = new ImageViewTouch(GalleryTouchTestActivity.this); imageView.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); final Options options = new Options(); options.outHeight = (int) scaleHeight; // new smaller height options.outWidth = (int) scaleWidth; // new smaller

No Images Found in Gallery

≯℡__Kan透↙ 提交于 2019-12-11 03:55:18
问题 I need to test a function that needs to picks some images from the gallery of Android JellyBean Emulator. So I have downloaded from internet using the own browser of the emulator (that is slow as the hell) some images. The images appears in the downloaded files but not in the Gallery of Emulator. In the GingerBread emulator when I download an images from the browser these appear automatically in the gallery. How could I force the emulator to find the images? 回答1: In the old emulator the media

Exception picking a image from gallery (SD Card) for use on my app… java.lang.OutOfMemoryError: bitmap size exceeds VM budget

天大地大妈咪最大 提交于 2019-12-11 03:29:24
问题 i am picking images on my app with android, and i dont know why, sometimes i got an exception, i think it's allways i select a image with more than 400 or 500 kb's but i am not sure. Why? because when i select small images of 100 kb i dont get the exception, and when i get images with high KB or MB, it crash WITH java.lang.OutOfMemoryError: bitmap size exceeds VM budget . BUT VERY IMPORTANT: it crashes on the emulator but ALSO CRASH ON MY PHONE, is not a failure of the emulator. this is my

Android: Cannot cast from View to Gallery

我的梦境 提交于 2019-12-10 23:56:14
问题 I'd like to make a Gallery in android. In order to set the adapter in need to get the gallery which I defined in my xml file. Im doing that as: Gallery g = (Gallery) findViewById(R.id.gallery1); But with this code I can't compile my project, since I get the Error "Cannot cast from View to Gallery". My xml-file looks like this: " <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width=