Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use universal <a href="https://github.com/nostra13/Android-Universal-Image-Loader" rel="nofollow">image loader library</a> and then following way</p> <pre><code> --------------------------------------------------------- 1 - options = new DisplayImageOptions.Builder() .showStubImage(R.drawable.physicalgift_normal) .cacheInMemory() .cacheOnDisc() .displayer(new RoundedBitmapDisplayer(10)) .build(); imageLoader=ImageLoader.getInstance(); ImageLoaderConfiguration imgconfig=ImageLoaderConfiguration.createDefault(context); imageLoader.init(imgconfig); ---------------------------------------------------------- 2 - String url=list.get(position).getThumbUrl(); if(url != null &amp;&amp; url !="") imageLoader.displayImage(Utils.getEncodedUrl(url), holder.img, options); ------------------------------------------------------------ 3 - SubCatAdapter adapter = new SubCatAdapter(SubCategoryActivity.this, mlist); list.setAdapter(adapter); ------------------------------------------------------------ full example is here public class SubCatAdapter extends BaseAdapter { private ArrayList&lt;SubcategoryData&gt; list; private LayoutInflater inflator; public ImageLoader imageLoader; private DisplayImageOptions options; public SubCatAdapter(Context context, ArrayList&lt;SubcategoryData&gt; mlist) { super(); this.list = mlist; this.inflator = LayoutInflater.from(context); options = new DisplayImageOptions.Builder() .showStubImage(R.drawable.physicalgift_normal) .cacheInMemory() .cacheOnDisc() .displayer(new RoundedBitmapDisplayer(10)) .build(); imageLoader=ImageLoader.getInstance(); ImageLoaderConfiguration imgconfig=ImageLoaderConfiguration.createDefault(context); imageLoader.init(imgconfig); } public int getCount() { // TODO Auto-generated method stub return list.size(); } public Object getItem(int position) { // TODO Auto-generated method stub return list.get(position); } public long getItemId(int position) { // TODO Auto-generated method stub return position; } public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub View view = convertView; ViewHolder holder = null; if (convertView == null) { view = inflator.inflate(R.layout.row_subcat, null); holder = new ViewHolder(); holder.txt_Name = (TextView) view.findViewById(R.id.txt_name); holder.img=(ImageView)view.findViewById(R.id.img_row); view.setTag(holder); } else { holder = (ViewHolder) view.getTag(); } holder.txt_Name.setText(list.get(position).getName()); String url=list.get(position).getThumbUrl(); if(url != null &amp;&amp; url !="") imageLoader.displayImage(Utils.getEncodedUrl(url), holder.img, options); return view; } static class ViewHolder { TextView txt_Name; ImageView img; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload