七零部落格
思则大道至简,疑则谜团重重!
思则大道至简,疑则谜团重重!
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