title: How to access 'findViewById' method inside Dialog onClick event
body: <p>I'm having a custom layout xml file named login_form with a <code>LinearLayout</code> root named <code>login_form_root</code>. I'm trying to display this layout using dialog but can't get values from <code>EditText</code> as I get cannot resolve method <code>findViewById</code> inside onCreateDialog.</p>
  
  <pre><code>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
  final LayoutInflater inflater = getActivity().getLayoutInflater();
  builder.setView(inflater.inflate(R.layout.login_form, null));
  builder.setPositiveButton(okText, new DialogInterface.OnClickListener() {
  
  @Override
  public void onClick(DialogInterface dialog, int which) {
         View myView = inflater.inflate(R.layout.login_form, (ViewGroup) findViewById(R.id.login_form_root));
         EditText userEmail = (EditText) myView.findViewById(R.id.email_address);
         userEmailValue = userEmail.getText().toString();
         Toast.makeText(getActivity(), userEmailValue, Toast.LENGTH_SHORT).show();
          }
  </code></pre>
  
  <p><strong>Error</strong> is here:-</p>
  
  <blockquote>
    <p>"(ViewGroup) findViewById(R.id.login_form_root)" </p>
  </blockquote>
  
  <p>so how can I inflate the custom layout to get EditText values?</p>