Hi,

I have listview and i will be loading a RelativeLayout as its row
contents

<ListView android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

rowcontents.xml
--------------------
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
        <ImageView
        android:layout_width="60px"
        android:layout_height="60px"/>
        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
</RelativeLayout >

When scrolling the list i need to re assign the image source. Am
trying to get whole contents of the row to a local variable and using
getChild(index) .

Inside scroll listener
----------------------------
for(int i=view.getFirstVisiblePosition();
i<view.getLastVisiblePosition; i++)
{
  RelativeLayout rl = (RelativeLayout) getListView().getChildAt(i);
  imageView iv = (ImageView) rl.getChildAt(0);
  iv.setImageResource(R.drawable.eatin);
}
but, am getting NullPointerException. Please give suggestions.


Regards
Veradis

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to