LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.dialog,
(ViewGroup) findViewById(R.id.dialog));
final EditText longitude, latitude;
AlertDialog.Builder dialog = new AlertDialog.Builder(this);
longitude = (EditText)layout.findViewById(R.id.longitude);
latitude = (EditText)layout.findViewById(R.id.latitude);
dialog.setTitle("自定义布局").setView(layout)
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
String lon = longitude.getText().toString();
}
}).setNegativeButton("取消", null).show();
alertDialog多EditText获取内容
最新推荐文章于 2023-09-15 16:59:41 发布