I’d like to create an application for tablets using 2 panels. The left one as a menu and the right one as a content presenter. In fact the behavior I expect is similar to the one in Gmail app.

I’m currently using 2 fragments. One is basically a ListView with room names plus some buttons. The other one (the content) includes some information about the selected room.
The room I select in the left panel should stay highlighted – like in the Gmail app. I was trying for many hours to achieve this effect using selectors, but failed.
Moreover I found 2 different opinions about this approach..
1) “Do not try to keep the focus or selection in touch mode”
Can you tell me how to achieve this (just to keep the selected item distinguished from the rest)?
Maybe a ListView isn’t the best approach here?
UPDATE
Thanks to Christoph Eberhardt’s answer I created a sample project that works fine. It’s available on github.
Create an xml file in res/drawable/list_item_selector.xml
For the list elements make an own xml file res/layout/list_item.xml
Then when creating the list adapter do:
Now all you have to do is providing the drawables list_default and list_pressed and list_altered
The CustomAdpater looks like:
Edit:And if you don’t have it already:
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
Edit:
Don’t set the choice mode with a plain ListView, only makes sense if you have e.g. a ListFragment as I have in my code
It’s not perfect now, but from now on you should be fine after playing around a bit.
What also might help is: ListView item background via custom selector
Edit:
Now it should work as you want it^^