Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>try this....</p> <pre><code>public class ImagePreviewAdapter extends BaseAdapter { private Context mContext; private List&lt;LastPost&gt; mPosts = new ArrayList&lt;LastPost&gt;(); private ImageLoader mImageLoader; private ImageLoadingListener mLoadingListener; /** * Constructor * * @param context * @param posts * @param listener - using for showing loading progress */ public ImagePreviewAdapter(Context context, List&lt;LastPost&gt; posts, ImageLoadingListener listener) { this.mContext = context; this.mPosts = posts; this.mLoadingListener = listener; Activity activity = (Activity)mContext; this.mImageLoader = ((MeanwhileInRussia)activity.getApplication()).getImageLoader(); } public int getCount() { return mPosts.size(); } public LastPost getItem(int position) { return mPosts.get(position); } public long getItemId(int position) { LastPost post = mPosts.get(position); return Long.parseLong(post.getId()); } /* * Create a new ImageView for each item referenced by the Adapter */ public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; // if it's not recycled, initialize some attributes if (convertView == null) { imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(125, 125)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(0, 0, 0, 0); } else { ImageView restoringView = (ImageView)convertView; imageView = restoringView; } final String imageLink = mPosts.get(position).getImageurl(); final DisplayImageOptions displayImgOptions = ImageLoaderConfigUtil .getDisplayImageOptions(mContext); if (mLoadingListener != null) { mImageLoader.displayImage(imageLink, imageView,displayImgOptions,mLoadingListener); } else { mImageLoader.displayImage(imageLink, imageView, displayImgOptions); } return imageView; } } </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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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