【发布时间】:2014-06-26 10:11:50
【问题描述】:
当单击列表视图的按钮(外部-不在列表项中)时,我想专注于下一个列表项。 我试过这样但它不起作用:
vegetableList.setAdapter(new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, vegList));
vegetableList.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
current_veg_item = vegList[position];
parent.getChildAt(position).setBackgroundColor(Color.parseColor("#33cc99"));
if (save != -1 && save != position)
{
parent.getChildAt(save).setBackgroundColor(Color.WHITE);
}
save = position;
}
});
按钮OnClickListener:
OnClick{
vegetableList.setItemChecked(3, true);
}
当我点击按钮时如何聚焦当前选中项目的下一个项目?
【问题讨论】: