当我打开图库时,在imageview中显示图像我正在OutOfMemoryError
。只需单击按钮并打开移动图库,然后从库中选择图像并设置为imageview。
我有这个错误。
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代码:
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);
}
答案 0 :(得分:0)
您需要为模拟器分配更多内存才能查看大数据