Android使用AlertDialog弹出对话框时,如果需要自定义对话框界面,就需要用到setView来设置界面,此时,界面上一般都会有需响应或需记录结果的控件,这就需要查找控件了。下面就是一个在自定义对话框中查找控件并进行响应的实例:
LayoutInflater layoutInflater = LayoutInflater.from(mContext);
View newPlanDialog = layoutInflater.inflate(R.layout.new_plan_dialog,
(ViewGroup)findViewById(R.id.LinearLayout_newplan));
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this)
.setTitle(