title: how to get text from EditText within a Fragment and not activity
body: <p>I am trying to get the text from an EditText in an XML I have:`</p>
  
  <p>this is my XML</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;ScrollView
          android:id="@+id/scrollView1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:background="@color/background"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:id="@+id/name"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginBottom="5dp"
                  android:layout_marginLeft="30dp"
                  android:layout_marginTop="15dp"
                  android:text="Name"
                  android:textColor="@color/accent_red"
                  android:textSize="25sp" /&gt;
  
              &lt;EditText
                  android:id="@+id/editContactName"
                  android:layout_width="match_parent"
                  android:layout_height="50dp"
                  android:background="@drawable/border"
                  android:ems="10"
                  android:hint="Name"
                  android:imeOptions="actionNext"
                  android:inputType="textPersonName"
                  android:paddingLeft="30dp"
                  android:paddingRight="30dp"
                  android:textSize="30sp" /&gt;
         &lt;/LinearLayout&gt;
     &lt;/ScrollView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>This is my class classed SHConfigureContactFragment</p>
  
  <pre><code>public class SHConfigureContactFragment extends Fragment{
  
      private EditText name; 
      private EditText description; 
      private EditText primaryNumber; 
      private EditText secondaryNumber; 
      private EditText email; 
      private EditText skype; 
      private Byte[] photo; 
  
      private Boolean isDualPane; 
      private FragmentManager fragmentManager; 
      private SHContactMenuFragment menuFragment; 
      private SHConfigureContactFragment contactFragment; 
  
      private DatabaseControllerLibrary databaseController; 
      private Contact contact;
  
      public int selectedIndex; 
  
      public void onActivityCreated(Bundle savedInstanceState) {
          super.onActivityCreated(savedInstanceState);
          if(savedInstanceState != null) {
              this.selectedIndex = savedInstanceState.getInt("SELECTED_INDEX");
              this.contact = (Contact) savedInstanceState.getSerializable("CONTACT");
          }
      }
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
      }
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
          super.onCreateView(inflater, container, savedInstanceState);
          View rootView = inflater.inflate(R.layout.sh_fragment_contact_edit, container, false);
          return rootView; 
      }
  
      private void setupTextFieldsByContact(Contact contact) {
          name = (EditText) findViewById(R.id.editContactName);
  //      description = (EditText) findViewById(R.id.editContactDescription);
  //      primaryNumber = (EditText) findViewById(R.id.editContactPrimaryNumber);
  //      secondaryNumber = (EditText) findViewById(R.id.editContactSecondaryNumber);
  //      email = (EditText) findViewById(R.id.editContactEmail);
  //      skype = (EditText) findViewById(R.id.editContactSkype);
  
          if (contact != null) {
              name.setText(contact.getName());
              description.setText(contact.getDescription());
              primaryNumber.setText(contact.getPrimaryNumber());
              secondaryNumber.setText(contact.getSecondaryNumber());
              email.setText(contact.getEmail());
              skype.setText(contact.getSkype());
          }
      }
  
  
  }
  </code></pre>
  
  <p>It seems as though I cannot <code>callfindViewById(R.id.editContactName)</code>because I am not extending an Activity. I have looked at various posts here but have not found a solution. I thought about using <code>getText()</code> method, but that does not let me get specific EditText elements. I hope to have many editable fields that is why I need to get by the specific ID's</p>