0
我想提出一个表单,我必须使用复选框view.i作出了清单,检查box.i不能在EditText上展示信息时,列表中的项目进行检查,并取消选中列表。 这里是我的代码----自定义列表视图的android的onClick
private void getCustomListitem(){
_lvcustom=(ListView)findViewById(R.id.lvcustom);
String datas[]={"one","two"};
simpleListAdap = new SimpleListAdapter_Custom(_act , data);
_lvcustom.setAdapter(simpleListAdap);
public class SimpleListAdapter_Custom extends ArrayAdapter<String>{
private Activity _parent;
private String[] _data;
private EditText _et;
public SimpleListAdapter_Custom(Activity parent, String[] data) {
super(parent, R.layout.simple_list_custom, data);
// TODO Auto-generated constructor stub
this._parent = parent;
this._data = data;
}
@Override
public View getView(int position, View convertView, ViewGroup parent){
LayoutInflater inflater = this._parent.getLayoutInflater();
View curView = inflater.inflate(R.layout.simple_list_custom, parent,false);
final CheckBox cb = (CheckBox) curView.findViewById(R.id.cb01);
// cb.setChecked(_data.length);
cb.setTag(_data);
final TextView chkTxtView = (TextView) curView.findViewById(R.id.label);
chkTxtView.setText(this._data[position]);
return curView;
}
}
又有什么问题呢? – Kristopher
单击列表中的任何项目时,我想在编辑文本中显示其相关信息 – user1859771