I would like to know how to set a URL in an ImageView variable, I do not know if I was clear?
private final DisplayImageOptions options;
public NoticiasAdapter(Activity activity, List objects) {
super(activity, R.layout.noticia_list_item , objects);
this.activity = activity;
this.stocks = objects;
options = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(true)
.build();
}
public View getView(int position, View convertView, ViewGroup parent) {
View rowView = convertView;
StockQuoteView sqView = null;
if(rowView == null)
{
LayoutInflater inflater = activity.getLayoutInflater();
rowView = inflater.inflate(R.layout.noticia_list_item, null);
sqView = new StockQuoteView();
//sqView.quote = (TextView) rowView.findViewById(R.id.ticker_symbol);
sqView.ticker = (TextView) rowView.findViewById(R.id.ticker_price);
sqView.img = (ImageView) rowView.findViewById(R.id.img);
rowView.setTag(sqView);
} else {
sqView = (StockQuoteView) rowView.getTag();
}
Noticias currentStock = (Noticias) stocks.get(position);
String imagem3 = currentStock.getImagem();
sqView.ticker.setText(currentStock.getTitulo());
ImageLoader.getInstance().displayImage(imagem3, sqView.img, options);
return rowView;
}
protected static class StockQuoteView {
protected TextView ticker;
protected TextView quote;
protected ImageView img;
}