Вот код адаптера которьій грузит картинки.
Код: Выделить всё
public ImageAapter(Context context, String[] imagesurls) {
super(context, R.layout.list_item, imagesurls);
mInflater = LayoutInflater.from(context);
mPicasso = Picasso.with(context);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = convertView;
if (view == null) {
view = mInflater.inflate(R.layout.list_item, parent, false);
}
ImageView imageView = (ImageView) view.findViewById(R.id.imageView);
mPicasso.load(getItem(position)).resizeDimen(R.dimen.image_size, R.dimen.image_size). centerInside().into(imageView);
return view;
}
}
Код: Выделить всё
public class Clear {
public static void clearCache (Picasso p) {
p.cache.clear();
}
}
И заодно подскажите как можна удалать информацьію из лист вью елементьі котого уже не видно на екране. Тоисть чтоб от центрального отображаемого елемента назат и в перед в View бьіло загружено по 5 елементов. Как ето реализовать?