I have a listview, and I want to set the background color of the first item at onCreate. I tried this:
mDrawerList = (ListView) findViewById(R.id.navList);
DrawerListAdapter adapter = new DrawerListAdapter(this, mNavItems);
mDrawerList.setAdapter(adapter);
View view = mDrawerList.getChildAt(1);
view.setBackgroundColor((parseColor("#008CC3")));
But it gives NPE. How can I do this?