public void showAddIPCDialog() {
Log.i("ssssssssss","wwwwwwwwww");
LayoutInflater inflater = this.getActivity().getLayoutInflater();
Log.i("ssssssssssinflater",inflater+"");
//错误
// final View layout = inflater.inflate(R.layout.addipc, (ViewGroup) findViewById(R.id.addipc_dialog));//添加布局
//正确
final View layout = inflater.inflate(R.layout.addipc, null);//添加布局
Log.i("sssssssssslayout",layout+"");
EditText etName = (EditText) layout.findViewById(R.id.et_camera_name);
EditText edit = (EditText) layout.findViewById(R.id.sn);
EditText editps = (EditText) layout.findViewById(R.id.password);
new AlertDialog.Builder(this.getActivity()).setTitle("添加监控摄像头").setView(layout)
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
}
}).setNegativeButton("取消", null).show();
}
//总结:复制需谨慎