[android-developers] listview/scrolling not working properly
I do not know if someone else notice too, but while I was testing my
App, the scrolling was working, but in a incorrect way.
I have a listview that have some rows and in each row I have
imageviews. But in ImageView it is a different picture.
All that I want is to display different pics in differents imageviews
in a listview. However when I scroll up or down really fast the
imageview´s start to change the imagem between themselves. It is so
weird. I do not know why this came to happen.
Some ideas?
I have this method that sets an image in imageview inside a listview
((ListView)findViewById(R.id.lvCidadeInfoPrevisao)).setOnHierarchyChangeListener(new
OnHierarchyChangeListener() {
public void onChildViewAdded(View parent, View child) {
int position = ((ListView)parent).getPositionForView(child);
ListView listaPrevisao =
(ListView)findViewById(R.id.lvCidadeInfoPrevisao);
String tempo = previsao.get(position).getTempo().trim();
try{
if((((LinearLayout)listaPrevisao.getChildAt(position))).getChildAt(0)!
=null ){
//System.out.println("---------------\nParent:
"+parent.getClass()+"\nChild: "+child.getClass()+"\nFilho do child: "+
(((LinearLayout)listaPrevisao.getChildAt(position))).getChildAt(0).getClass()
+"\nRow-Count: "+listaPrevisao.getChildCount() +"\nPosition
===="+position);
child.setBackgroundResource(R.drawable.mobile_menu_buttons);//
setts the background of each row of the listview
populaListaComIcones(position, tempo, listaPrevisao);//populate
list with icons
}
}catch (NullPointerException e) {
e.printStackTrace();
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home