Android 带输入框的弹出框

原文地址为: Android 带输入框的弹出框

      final EditText inputServer = new EditText(this);
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Server").setIcon(android.R.drawable.ic_dialog_info).setView(inputServer)
                .setNegativeButton("Cancel", null);
        builder.setPositiveButton("Ok", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
               inputServer.getText().toString();
             }
        });
        builder.show();

OR

见SDK自带的源代码Api Demos里的: 

App -> Dialog -> Text Entry dialog


转载请注明本文地址: Android 带输入框的弹出框

你可能感兴趣的:(Android 带输入框的弹出框)