title: I can't use findViewById
body: <p>Why can't I use <code>findViewById</code> in this file?</p>
  
  <p>Regfragment :</p>
  
  <pre><code>import android.support.v4.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.EditText;
  
  
  public class RegFragment extends Fragment {
  
  EditText text1,text2,text3;
  Button btn1;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
      View rootView = inflater.inflate(R.layout.reg_layout, container, false);
  
      return rootView;
  
  
  }
  }
  </code></pre>
  
  <p>and then I tried to make like this:</p>
  
  <pre><code>import android.support.v4.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.EditText;
  
  
  public class RegFragment extends Fragment {
  
  EditText text1,text2,text3;
  Button btn1;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
  
      View rootView = inflater.inflate(R.layout.reg_layout, container, false);
  
      return rootView;
  
      text1 = (EditText) findViewById(R.id.text1);   -----&gt; ERROR....
  }
  }
  </code></pre>
  
  <p>I got error<br>
  Is it because I use Fragments ?<br></p>