title: How to get EditText from fragment
body: <p>I created the AlerDialog:</p>
  <pre><code>AlertDialog.Builder alert = new AlertDialog.Builder(appContext);
  
                  alert.setTitle(&quot;Add subcontractors&quot;).setView(R.layout.add_subcontractor_form);
                  
                  //final EditText input = new EditText(appContext);
  
                  alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int whichButton) {
                          String YouEditTextValue = input.getText().toString();
                      }
                  });
  
                  alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                      public void onClick(DialogInterface dialog, int whichButton) {
                          // what ever you want to do with No option.
                      }
                  });
  
                  alert.show();
  </code></pre>
  <p>And have the layout for it:</p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      &gt;
             &lt;EditText
              android:layout_margin=&quot;10dp&quot;
              android:id=&quot;@+id/et_sub_name&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;match_parent&quot;
              android:hint=&quot;Type name here&quot;
              android:textSize=&quot;20sp&quot;/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>My question is, how to get EditText view from my layout in code?
  Because I want to have an inputted text after the user pressed the &quot;OK&quot; button.</p>