bitmapfactory

Displaying images from a specific folder on the SDCard using a gridview

柔情痞子 提交于 2019-11-26 06:38:37
问题 I\'m attempting to create a gridview that is loaded with images from a specific folder that resides on an SDCard. The path to the folder is known, (\"/sdcard/pictures\") , but in the examples I\'ve seen online I am unsure how or where to specify the path to the pictures folder I want to load images from. I have read through dozens of tutorials, even the HelloGridView tutorial at developer.android.com but those tutorials do not teach me what i am seeking. Every tutorial I have read so far has

How to solve java.lang.OutOfMemoryError trouble in Android

我们两清 提交于 2019-11-25 23:53:53
问题 Altough I have very small size image in drawable folder, I am getting this error from users. And I am not using any bitmap function in code. At least intentionally :) java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:683) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:513) at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:889) at