1
Well 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;
}
You want an Imageview that loads images of Urls from the internet?
– André Ribeiro
That’s right...
– Gustavo
Hello, that question has been asked and answered here: http://answall.com/questions/39883/display-uma-imagem-atrav%C3%A9s-de-url/39895#39895
– rsicarelli
Hello, I saw the answer, I think the answer they gave me was clearer, no?
– Gustavo
@Gustavo wrote an answer that can help you!
– rsicarelli