Android弹出对话框

 
  
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
String money="37737.92";
private void showDialog(){
    AlertDialog.Builder builder=new AlertDialog.Builder(this);
    builder.setTitle("您好!");
    builder.setMessage("您的可用预存款为:"+money+"元");
    builder.setPositiveButton("确定",
            new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialogInterface, int i) {

                }
            });
    AlertDialog dialog=builder.create();
    dialog.show();
}
效果如下:
Android弹出对话框_第1张图片

你可能感兴趣的:(Android弹出对话框)