我在一项活动中有两个列表视图。我为每个设置了适配器。
这就是我所拥有的:
lv.setAdapter(new ArrayAdapter<String>(this,
R.layout.custom_list_item_1, classesBradycardia));
specialist.setAdapter(new ArrayAdapter<String>(this,
R.layout.custom_list_item_1, specialistBradycardia));
lv.setOnItemClickListener(this);
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
// TODO Auto-generated method stub
String selectedVal = //((TextView) v).getText().toString();
lv.getItemAtPosition(position).toString();
Log.d(selectedVal, "it's in " + selectedVal);
final int result = 1;
Bundle extras = new Bundle();
switch(v.getId()){
case R.id.lvSpecificTest:
if(selectedVal.equals("Electrocardiogram")){
Intent ecg = new Intent(this, ViewTest.class);
extras.putString("viewtest", "Electrocardiogram");
ecg.putExtras(extras);
startActivityForResult(ecg, result);
我把登录放在里面。它正在显示所选项目,但不会进入下一个活动。我在这里想念什么?