On the tablet tablets of my application’s tablet, I have three lists and one regular fragment, let’s call them Make, Model, Size and Details. The Make list is initially populated, then, based on the Make selection, the Model list is selected; when a model is selected, the "Size" list is populated; when size is selected, details are displayed. Each of these events (selection of list items) is processed through the onListItemClick handler.
When I start, I want to fill in the Make list, select the first Make in the list and pass it through the onListItemClick handler to populate the Model list (and so on, so that all the lists are filled and details are shown) this should also be the behavior when there is any choice made in any of the lists - select the first item in the following list until we see the details). Please note that I have control over the database, and for each Make there will always be at least one model for each Make / Model, at least one size for each Make / Model / Size in exactly one detail.
So, I want to select the first item in the list and call its onListItemClick handler. I tried the following (with appropriate border checking, etc.), but it does not work.
getListView().setItemChecked(0, true);
The only changes to the “out of the box” ListFragment is to set CacheColorHint as such
getListView().setCacheColorHint(R.color.GhostWhite);
where GhostWhite is set to styles.xml as
<color name="GhostWhite">#88FFFFFF</color>
Any ideas?
Thanks in advance.
source share