디비와 리스트뷰를 연동하기 위해 아래와 같이 SimpleCursorAdapter을 사용했구요.

리스트 뷰의 셀별로 배경을 지정해주기 위해서는 아래와 같이 해주면 되는데

이 때 position(셀의 index)을 어떻게 구해야 할 지 모르겠어요..

getPosition 뭐 이런 것 없나요?ㅠㅠ

조언 부탁드립니다.


mListView.setBackgroundResource((position & 1) == 1 ? R.drawable.bg_list1 : R.drawable.bg_list2);


AdapterStomach=new SimpleCursorAdapter(mListView.getContext(), R.layout.page_list_listview, cursor, 

    new String[]{"m_name", "tag_line"},new int[]{R.id.toptext, R.id.bottomtext});

    

    mListView.setAdapter(AdapterStomach);

    mListView.setBackgroundResource(R.drawable.bg_list1);