使可扩展列表视图的单击侦听器工作时遇到问题。我是否正确地执行了这一点?
代码:
elv = getExpandableListView();
// Set up the adapter
mAdapter = new MyExpandableListAdapter();
elv.setAdapter(mAdapter);
elv.setOnChildClickListener(new OnChildClickListener() {
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
Toast.makeText(getApplicationContext(), "click", Toast.LENGTH_SHORT);
v.setBackgroundColor(0x000000);
return false;
}
});
最佳答案
您尚未在吐司消息中调用show()。所以,如果你决定它是否只对祝酒词起作用,它似乎就不起作用了。add.show();在创建吐司的行的末尾,它应该出现