我想设置一个简单的Alert View的OK按钮来充当后退按钮。我应该使用什么方法?设置一个按钮作为后退按钮
AlertDialog.Builder alt_bld = new AlertDialog.Builder(this.getContext());
AlertDialog alert = alt_bld.create();
alert.setTitle("Your score is: " + score);
alert.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//here would be the "back button's method"
}});
alert.show();
是否要完成活动?或者你想解雇Dailog?请清除 – Arslan 2012-02-01 13:03:58
我想完成当前的活动并关闭对话框,并返回上一个活动。 – MMMM 2012-02-01 13:10:28