i have a ListView showing news with images, and set when (position == 0) change the layout, and then a normal listview_row for the following news, but this only applies for the 3 items showed on screen, then the position goes back to 0 and changes the view again, any help here?
Here is my lazyAdapter code,
vi = convertView;
Log.d("NOTICIAS", "P0sition: " + position);
// set Layout for 1rst item
if (convertView==null && position == 0) {
vi = inflater.inflate(R.layout.noticias_list_item_first, null);
}
// set layout for the next items
else if(convertView==null && position != 0){
vi = inflater.inflate(R.layout.noticias_list_item, null);
}
TextView news_id = (TextView)vi.findViewById(R.id.news_id); // news_id
TextView news_titulo = (TextView)vi.findViewById(R.id.news_titulo); // news_titulo
TextView news_desc = (TextView)vi.findViewById(R.id.news_desc); // news_desc
//TextView news_fecha = (TextView)vi.findViewById(R.id.news_fecha); // news_fecha
ImageView news_img = (ImageView)vi.findViewById(R.id.news_img); // news_img
HashMap<String, String> news = new HashMap<String, String>();
news = data.get(position);
// Setting all values in listview
news_id.setText(news.get(NoticiasActivity.TAG_NEWS_ID));
news_titulo.setText(news.get(NoticiasActivity.TAG_NEWS_TITULO));
news_desc.setText(news.get(NoticiasActivity.TAG_NEWS_DESC));
//news_fecha.setText(song.get(NoticiasActivity.TAG_NEWS_FECHA));
imageLoader.DisplayImage(news.get(NoticiasActivity.TAG_NEWS_IMG), news_img);
return vi;