实现类OnClickListener的实现方法和老师的不一样,怎么回事?
实现OnClickListener得到方法是
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
还是
public void onClick(View v) {
// TODO Auto-generated method stub
}
怎么做的和老师讲的不一样呢,有没有遇见的同学呢,或者老师给解决一下?
API是这样写的:
interface OnClickListener {
/**
* This method will be invoked when a button in the dialog is clicked.
*
* @param dialog The dialog that received the click.
* @param which The button that was clicked (e.g.
* {@link DialogInterface#BUTTON1}) or the position
* of the item clicked.
*/
/* TODO: Change to use BUTTON_POSITIVE after API council */
public void onClick(DialogInterface dialog, int which);
}