当我点击一个按钮时,它确实在一个 LinearLayout 内,我在这一行得到这个错误:
LinearLayout ll = (LinearLayout) view;
我的方法如下所示:
public void adjDoa(final View view) {
final CharSequence[] items = {"Get on with it!", "Doable!", "Maybe, maybe not.", "Unlikely!", "When pigs fly!"};
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(GetItActivity.this);
dialogBuilder.setTitle("Choose doability!");
dialogBuilder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
LinearLayout ll = (LinearLayout) view;
TextView text = (TextView)ll.findViewById(R.id.tViewChDoa);
text.setText(items[which]);
}
});
dialogBuilder.create().show();
}
这是什么意思?