1
如果有效,将会是第一个应用程序。 约有290项。打开一个新的页面被点击。但错误后的“开关”或“如果”超过250个。可能是什么原因?android listview
if (position == 0) {
Intent newActivity = new Intent(this, otobus5.class);
startActivity(newActivity);
} else if (position == 1) {
Intent newActivity6 = new Intent(this, otobus6.class);
startActivity(newActivity6);
}
.
.
.
if (position == 290) {
Intent newActivity = new Intent(this, otobus290.class);
startActivity(newActivity);
} else if (position == 291) {
Intent newActivity6 = new Intent(this, otobus291.class);
startActivity(newActivity6);
}
我不明白你要做什么,但有290如果声明肯定是错误的。解释你真正的问题,我们可以给你一个更好的解决方案。 – Kaj 2011-05-26 18:06:39
一般提示,如果使用:-),则使用开关而不使用其他开关。你的问题还不清楚,你可以重述吗? – 2011-05-26 18:08:54
亲爱的上帝,请告诉我你真的没有290个不同的班级... – kcoppock 2011-05-26 18:12:04