Android 如何将radiobutton添加到光标适配器,该适配器与单选组中的radiobutton类似,即对radiobutton进行分组 editstudent.xml 编辑学生名单 学生积极性

Android 如何将radiobutton添加到光标适配器,该适配器与单选组中的radiobutton类似,即对radiobutton进行分组 editstudent.xml 编辑学生名单 学生积极性,android,Android,这里有一个自定义布局(editnumberlist.xml),有两个文本框和一个单选按钮。它是使用simpleCursorAdapter添加到(editstuden.xml)中的,并且可以正常工作 但我希望单选按钮的行为与单选组中的一样(例如,一次选择一个选项)。我的另一个问题是如何将StudentHelper.KEY\u ID赋予不应在运行时/执行时显示的单选按钮。另外,如何在onListItemClick()函数中获取StudentHelper.KEY\ID的值 有人知道如何实现这个吗?尝试

这里有一个自定义布局(editnumberlist.xml),有两个文本框和一个单选按钮。它是使用
simpleCursorAdapter
添加到(editstuden.xml)中的,并且可以正常工作

但我希望单选按钮的行为与单选组中的一样(例如,一次选择一个选项)。我的另一个问题是如何将
StudentHelper.KEY\u ID
赋予不应在运行时/执行时显示的单选按钮。另外,如何在
onListItemClick()
函数中获取
StudentHelper.KEY\ID
的值


有人知道如何实现这个吗?

尝试创建一个扩展“simpleCursorAdapter”的自定义适配器类,在代码中设置一个标志。。。该标志将保存当前选定无线电项目的索引。。。单击单选按钮的事件,重置所有其他事件并设置第一个事件
  LinearLayout 

      ListView
           android:id="@android:id/list"        
      ListView

  LinearLayout
  LinearLayout android:orientation="horizontal"  --  TOP Linear

       LinearLayout android:orientation="vertical"  -- sub Linear

           Tex0tView  android:id="@+id/enlist_tv_Name"  TextView

           TextView   android:id="@+id/enlist_tv_class" TextView

       LinearLayout -- sub Linear

       RadioButton  android:id="@+id/enList_rb_Id"   RadioButton

  LinearLayout --  TOP Linear
StudentActivity extends ListActivity {

    setContentView(R.layout.editstudent);

    //get the data from database

    Cursor cursor = noMgr.getAllStudent();

    String[] columns= {StdentHelper.KEY_NAME,StdentHelper.KEY_CLASS, StdentHelper.KEY_ID};
    int[] to=new int[]{R.id.enlist_tv_name, R.id.enlist_tv_class, R.id.enList_rb_id};

    SimpleCursorAdapter scAdapter=new SimpleCursorAdapter(this, R.layout.editstudentlist, cursor, columns, to);

    this.setListAdapter(scAdapter);

}