title: no suitable method found for add() error
body: <p>this is my code:</p>
  
  <pre><code>package com.example.wjdrmstn.myapplication;
  
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  
  public class MainActivity extends FragmentActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.news_articles);
  
          if(findViewById(R.id.fragment_container) != null) {
              if(savedInstanceState != null)
                  return;
  
              HeadlinesFragment firstFragment = new HeadlinesFragment();
              firstFragment.setArguments(getIntent().getExtras());
              getSupportFragmentManager().beginTransaction().add(R.id.fragment_container,firstFragment).commit();  //error occurred
          }
      }
  }
  </code></pre>
  
  <p>this code is from the android developer site:<br>
  <a href="https://developer.android.com/training/basics/fragments/fragment-ui.html" rel="nofollow noreferrer">https://developer.android.com/training/basics/fragments/fragment-ui.html</a></p>
  
  <p>here is error:</p>
  
  <pre><code>Error:(20, 59) error: no suitable method found for add(int,HeadlinesFragment)
  method FragmentTransaction.add(Fragment,String) is not applicable
  (argument mismatch; int cannot be converted to Fragment)
  method FragmentTransaction.add(int,Fragment) is not applicable
  (argument mismatch; HeadlinesFragment cannot be converted to Fragment)
  </code></pre>
  
  <p>EDIT: HeadlinesFragment code <br></p>
  
  <pre><code>package com.example.wjdrmstn.myapplication;
  
  import android.os.Bundle;
  import android.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  
  public class HeadlinesFragment extends Fragment {
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
          return inflater.inflate(R.layout.headlines_view, container, false);
      }
  }
  </code></pre>