android - Overcome out of memory Error when loading images into textview -


sorry if sound newb but.. =[

im working application need load large amount of images onto textview, didnt use webview becuz doesnt lead mobile view decide parse content , use html.fromhtml show textview.

problem is: if load page luckily there not images, run pretty smooth. otherwise error below...

anyone know if theres way can dispose source system memory after finished reading image?...or...any other way fix problem?

i used source here android imagegetter images overlapping text

    05-08 21:30:31.404: error/dalvikvm-heap(25083): out of memory on 1920016-byte allocation.     05-08 21:30:31.404: error/androidruntime(25083): fatal exception: asynctask #10     java.lang.runtimeexception: error occured while executing doinbackground()     @ android.os.asynctask$3.done(asynctask.java:299)     @ java.util.concurrent.futuretask$sync.innersetexception(futuretask.java:273)     @ java.util.concurrent.futuretask.setexception(futuretask.java:124)     @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:307)     @ java.util.concurrent.futuretask.run(futuretask.java:137)     @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1076)     @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:569)     @ java.lang.thread.run(thread.java:856)     caused by: java.lang.outofmemoryerror     @ android.graphics.bitmapfactory.nativedecodestream(native method)     @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:527)     @ android.graphics.bitmapfactory.decoderesourcestream(bitmapfactory.java:353)     @ android.graphics.drawable.drawable.createfromresourcestream(drawable.java:781)     @ android.graphics.drawable.drawable.createfromstream(drawable.java:741)     @ com.vilalab.five.model.urlimageparser$imagegetterasynctask.fetchdrawable(urlimageparser.java:90)     @ com.vilalab.five.model.urlimageparser$imagegetterasynctask.doinbackground(urlimageparser.java:58)     @ com.vilalab.five.model.urlimageparser$imagegetterasynctask.doinbackground(urlimageparser.java:48)     @ android.os.asynctask$2.call(asynctask.java:287)     @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:305)     ... 4 more    05-08 21:30:31.504: error/dalvikvm-heap(25083): out of memory on 1920016-byte allocation. 

check out this post, uses example of getting picutres sd card/gallery how downsample images avoid problem. pretty easy fix.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -