Picasso on custom ListView appear out of memory -


i'm using picasso load pictures assets floder have 900 pictures. when slided listview,the logcat appear out of memory.

my custom listrow places_layout.xml:

<?xml version="1.0" encoding="utf-8"?> <relativelayout  xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <imageview     android:id="@+id/iv_test"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_centerinparent="true"/>   </relativelayout> 

my custom adapter getview code

 public view getview(int position, view convertview, viewgroup parent) {     viewholder holder=null;     if(convertview==null){         holder=new viewholder();         convertview= layoutinflater.from(mcontext).inflate(r.layout.list_item,null);         holder.mimageview=(imageview)convertview.findviewbyid(r.id.iv_test);         convertview.settag(holder);     }else {         holder=(viewholder)convertview.gettag();     }     picasso.with(mcontext).load("file:///android_asset/picture/" + mpicturenames.get(position)).resize(200,200).into(holder.mimageview);     //  holder.mimageview.setimagebitmap(getpicture(position));      return convertview; } 


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -