Sunday, 15 April 2012

Android ListView With Drawable Images OutOfMemoryError -


I'm new to Android development and I'm running into a problem with memory. In terms of mobile I try to make iOS apps. As shown in this image is a key activity in my list:

screenshot

do I have 9 session, when I have the same image, it's easy to scroll, but when I use 9 different images, so it is Strtrs and when I list go down then I get Autofmemri error error:

  java.lang.OutOfMemoryError at android.graphics.bitmapFactory.nativeDecodeAsset andro (at android.graphics.bitmapFactory.decodeStream) (Basic Law) On id.graphics android.content.res on BitmapFactory.decodeResourceStream (BitmapFactory.java:422)) and android.graphics.drawable.Drawable.createFromResourceStream (drawable.java:840) android.content.res.Resources.loadDrawable (resources.java:2110) .Resources.getDrawable (resource. Java: 700) on ly.mann.kevinmann.transformingwork.CellAdapter.getView (CellAdapter.java:57)  

I've read some answers about her e To do similar things, but I have lost as little as what to do.

I am using the adapter to display the images:

  ObjSession cellData = mSessions.get (status); If (cellData! = Null) {// Previous Back String uri = "@ Drawable /" + cellData.mPreview; Drawable Rays; Int imageResource = mContext.getResources (). GetIdentifier (uri, null, mContext.getPackageName ()); Try {res = mContext.getResources (). GetDrawable (imageResource); } Hold (resource. Notfound exception e) {imageResource = mContext.getResources (). GetIdentifier ("@ Drawable / Following", blank, mContext.getPackageName ()); Res = mContext.getResources (). GetDrawable (imageResource); } Holder.feature imageview.Setmeage drawer (ridge); Holder.titleLabel.setText (cellData.mTitle); Holder.introLabel.setText (cellData.mIntro); }  to 

Any help amazing will

Edit: I have tried since the listed possible Anulipan in the comments below - which The solution does not fix my issue, I have tried to take MDPI with HDPE and MDPI of MDL with MDPI.


No comments:

Post a Comment