Android's listview. Update view within of of the cells just after invalidating Activity's view

Posted by davs on Stack Overflow See other posts from Stack Overflow or by davs
Published on 2010-05-15T13:45:22Z Indexed on 2010/05/15 13:54 UTC
Read the original article Hit count: 220

Filed under:
|
|

I have ListViewActivity

public class SelectActivity extends ListActivity {
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.select_one_of);
        SimpleAdapter adapter = new SimpleAdapter(
            this,
            createChildList(),
            R.layout.select_one_of_childrow, 
            new String[] { KEY_VALUE },
            new int[] { R.id.selectoneof_add_new_item});
        setListAdapter(adapter);
    }
// ...
}

after setListAdapter() calls I would like to execute the following code:

((TextView) getListView().getChildAt(0).findViewById(R.id.selectoneof_add_new_item)).setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ticked, 0);

but getListView().getChildAt(xxx) returns null and I catch NullPointerException. Where should I put mentioned above code-snippet?

© Stack Overflow or respective owner

Related posts about android

Related posts about listview