当前位置:编程学习 > wap >>

谁知道为什么事件不相应,谢谢。。。

 当我点击Item后面的对号时,为什么没有相应发生,谢谢。          
                  mListView = new ListView(this);
mListView.setOnItemSelectedListener(this);
mListView.setChoiceMode(android.R.layout.simple_list_item_checked);
mAdapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_checked, mStrings);
mListView.setAdapter(mAdapter);


                  public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
position = ((int) arg3) + 1;
AlertDialog.Builder showRightorNot = new AlertDialog.Builder(this);
showRightorNot.setIcon(R.drawable.msg_warning);
showRightorNot.setTitle(position);
showRightorNot.setPositiveButton("确定", null).show();
         } --------------------编程问答-------------------- --------------------编程问答-------------------- 可能没有获得焦点,试着获得焦点 --------------------编程问答-------------------- showRightorNot.setPositiveButton("确定", null).show();改成showRightorNot.setPositiveButton("确定", null).create();试试…… --------------------编程问答-------------------- checkbox 设置 一个 focusable = false就可以了 
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,