title: adding a button in a fragment?
body: <p>I'm trying to add a button to my fragment layout but it says that the method <code>findViewByid</code> cannot be resolved. I'm implementing it in the <code>onCreateView</code> method in the fragment. Why is it giving me this error?</p>
  
  <pre><code>import android.support.v4.app.Fragment;
  import android.os.Bundle;
  import android.view.LayoutInflater;
  import android.view.ViewGroup;
  import android.view.View;
  import android.widget.Button;
  
  public class extra extends Fragment {
  
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          // Inflate the layout for this fragment
          Button myButton = (Button) findViewById(R.id.my_button);
          return inflater.inflate(R.layout.extra, container, false);
  
      }
  
  }
  </code></pre>