0

When i open gallery display a image in imageview i'm getting OutOfMemoryError. Just click a button and open a mobile gallery and select the image from gallery and set into imageview. I have got this error.

LogCat

07-12 16:38:41.628: E/AndroidRuntime(5746): FATAL EXCEPTION: main
07-12 16:38:41.628: E/AndroidRuntime(5746): java.lang.OutOfMemoryError
07-12 16:38:41.628: E/AndroidRuntime(5746):     at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:652)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:724)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at com.konylabs.api.ui.bl.e(Unknown Source)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at com.konylabs.api.ui.fz.a(Unknown Source)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at com.konylabs.api.ui.hb.run(Unknown Source)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at android.os.Handler.handleCallback(Handler.java:615)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at android.os.Handler.dispatchMessage(Handler.java:92)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at android.os.Looper.loop(Looper.java:137)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at android.app.ActivityThread.main(ActivityThread.java:4921)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at java.lang.reflect.Method.invokeNative(Native Method)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at java.lang.reflect.Method.invoke(Method.java:511)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
07-12 16:38:41.628: E/AndroidRuntime(5746):     at dalvik.system.NativeStart.main(Native Method)
07-12 16:38:41.648: E/android.os.Debug(2105): !@Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error

Java code:

function onselectioncallback(image)
        {
            var base_64 = kony.convertToBase64(image);
            PhoneAPI.img.base64 = base_64
        }
function open_media()
{
        var querycontext = {mimetype:"image/*"};
        returnStatus = kony.phone.openMediaGallery(onselectioncallback, querycontext);
}
oentoro
  • 740
  • 1
  • 11
  • 32

1 Answers1

0

You need to allocate more memory to the emulator to be able to view large data

Sully
  • 14,672
  • 5
  • 54
  • 79