I need a small help in List view. I am generating a list View, but whenever i do getChildAt(int position) it throws NullPointerException.
Here is the code
_list=(ListView)findViewById(android.R.id.list);
_loadListElements();
_showListUI();
_list.getChildAt(1).setBackgroundColor(Color.WHITE);
If you don’t have more than one child element then one will certainly give you a NullPointerException as you have to start counting from null upwards in prgramming. So you might want to try this.
But without more code and a logcat extract of the error stack it is hard to tell.