selected item on custom listview with contextual action bar

后端 未结 4 2005
一整个雨季
一整个雨季 2021-01-30 10:51

I recently started using android actionbars and contextual action bars (CAB).

I have just one activity which is a ListActivity. Basically I use the following code snippe

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 11:14

    Only trying to support ICS devices and up but this new layout does what you are trying to achieve, in keeping the selected line highlighted.

    adapter = new SimpleCursorAdapter(getActivity(),
         android.R.layout.simple_list_item_activated_1, 
         null, 
         from, 
         to,
         0);
    

提交回复
热议问题