当我点击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();
}
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();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货