I have a situation where I need to set a background on a LinearLayout programatically.
In my layout, I am setting my background using `android:background=\"?android:att
It's a bad idea doing it the way the accepted answer tells you to. The problem is that you also need to call the list's onItemCheckedStateChanged
to update what's needed (the action bar title for example).
In that case all you need to do is simply call getListView().setItemChecked(position, true);
when the item is checked and getListView().setItemChecked(position, false);
when it's not checked.