我在网上发现了一个Listview示例,我已经对其进行了修改。这个例子只是祝酒。我需要从listview中检索ID并在Switch中使用它。
listViewArticles.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// get the clicked folder name
String listItemText = ((TextView) view
.findViewById(R.id.textViewFolderName))
.getText()
.toString();
// just toast it
Toast.makeText(MainActivity.this,
"You clicked: " + listItemText, Toast.LENGTH_LONG)
.show();
}
});
需要使用开关:
switch ?????{
case ????:
minTid=10000;
maxTid=20000;
min.setText("00:00:10");
maxTimer.setText("00:00:20");
break;
case ????:
minTid=15000;
maxTid=30000;
minTimer.setText("00:00:15");
maxTimer.setText("00:00:30");
break;