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

yydnh88 2010-09-21 04:00:29
当我点击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();
}
...全文
100 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
aSysBang 2010-09-24
  • 打赏
  • 举报
回复
checkbox 设置 一个 focusable = false就可以了
煮咖啡 2010-09-23
  • 打赏
  • 举报
回复
showRightorNot.setPositiveButton("确定", null).show();改成showRightorNot.setPositiveButton("确定", null).create();试试……
凉凉二点凉 2010-09-22
  • 打赏
  • 举报
回复
可能没有获得焦点,试着获得焦点
  • 打赏
  • 举报
回复

80,488

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧