우선 이러한 형식으로 디비의 값을 가져오게 됩니다...
groupsCursor = mDbHelper.fetchAllGroups();
   startManagingCursor(groupsCursor);
  
   from = new String[] {GroupsDbAdapter.KEY_TITLE};
   to = new int[]{R.id.cb1 };
   groups = new SimpleCursorAdapter(this, R.layout.checkbox,groupsCursor, from, to);



여기서 R.id.cb1 은 CheckBox이고
R.layout.checkbox에 R.id.cb1이 있습니다.

이것들은 GroupListActivity에 listView에 붙여집니다.
GroupListActivity 에 setContentView(R.layout.grouplist); 되어있는 R.layout.grouplist 에는

<ListView
     android:id="@+id/android:list"
     android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"/>
이 있습니다.

제가 의도한것은 GroupListActivity라는곳에 listView가 있고 그 리스트뷰에 체크박스를 넣고
db의 내용을 리스트로 된 체크박스를 만드는것입니다.

여기까지는 되었는데 체크박스를 선택하고 그 선택한 checkbox 아이템을 삭제하려고합니다.
삭제를 하려면 선택한 체크박스의 아이디나 positoin을 가져와야 하는데
가져오지를 못하겠습니다..
getListView().getSelectedItemId()로 하면 리스트뷰의 선택한 아이템의 아디디를 가져오는데 저는 체크박스의 아이디를 가져오고싶습니다..

어떤식으로 가져와야 될까요?

아직 개념이 덜잡혀서 계속 헤매고 있습니다.. ㅠㅠ
profile

안드로이드를 매우 사랑하는!