views:

69

answers:

1

Hai friends,

In my application am displaying a list of names and respectives pictures ? i am picking picture from galery through Drawble.getFromPath(). ? am displaying list , some i encountered with out of memory error ? please help me to sort out this error ?

regards , srinivas

A: 

Well Srinivas, You should first check the size of your pictures, usually they should be pretty small but sometimes if you compress them incorrectly they will be too big.

Also, you should make sure you are using a custom adapter to create the gallery, that way you don't have to hold all the information of all the pictures in one go. A good example of this that is http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List14.html.

Though its not a gallery, its really easy to adapt into a gallery.

Finally, you should really use the search function. http://stackoverflow.com/questions/477572/android-strange-out-of-memory-issue/823966#823966

gogothee
thank u , gogothee . One thing i have to ask ,how can i set a bitmap as a backround to ImageView.
Srinivas