ListView m_ListView;
String[] data = new String[]{ "XXXX" };
m_ListView = (ListView) findViewById(R.id.sysdownlistView);
ArrayAdapter<String> aaCheckBoxAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_multiple_choice, data);
m_ListView.setAdapter(aaCheckBoxAdapter);
m_ListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
Button button = (Button) findViewById(R.id.button1);
button.setText("上 传");
button.setTextSize(32);
button.setOnClickListener(new Button.OnClickListener()
{
public void onClick(View v)
{
int iCheckedId;
boolean bCheckSign;
for (iCheckedId = 0; iCheckedId < m_ListView.getCount();iCheckedId++)
{
bCheckSign = false;
bCheckSign = m_ListView.getCheckedItemPositions().get(iCheckedId);
if(bCheckSign == true)
{
if(iCheckedId == 0)
{
ListView lv = (ListView) findViewById(R.id.sysdownlistView);
lv.removeAllViewsInLayout();
m_ListView.setItemChecked(iCheckedId, false);
}
}
}
}
}
);
android checked listview
最新推荐文章于 2024-07-24 21:35:56 发布