title: required android.support.v4.app.fragment
body: <p>i have simple project that have list view 
  when any one click on any item on list view 
  open in single window
  by fragment 
  the problem is that i want to replace my fragment with on of this tabs fragment on this project 
  <a href="http://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/" rel="nofollow noreferrer">http://www.truiton.com/2015/06/android-tabs-example-fragments-viewpager/</a></p>
  
  <p>i put my mainactivty class in switch case but it get to me this error
  in first picture 
  i try to import import android.support.v4.app.Fragment
  but also the same promplem </p>
  
  <p>this is the clases of my project 
  ....Main2Activity class</p>
  
  <pre><code>public class Main2Activity extends AppCompatActivity implements fragmentA.comunicatir
          {
  
          fragmentA f1;
          fragmentB f2;
          FragmentManager manegaer;
  
          @Override
          protected void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main2);
  
                  manegaer=getSupportFragmentManager();
          f1=(fragmentA)manegaer.findFragmentById(R.id.fragment1);
          f1.setcomunicatir(this);
          }
  
  
          @Override
          public void respned(int index){
                  f2=(fragmentB)manegaer.findFragmentById(R.id.fragment2);
  
          if(f2!=null&amp;&amp;f2.isVisible()){
  
          f2.cahngedata(index);
          }else{
          Intent intent=
          new Intent(this,
          AnotherActivity.class);
          intent.putExtra("index",index);
          startActivity(intent);
          }
  
  
          }
          }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/CxeDd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CxeDd.png" alt="error 2"></a></p>
  
  <p>the another classes 
  class fragmentA</p>
  
  <pre><code> public class fragmentA extends Fragment implements AdapterView.OnItemClickListener
  {
      ListView list;
      comunicatir  com;
      @Override
      public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState)
      {
          View view = inflater.inflate(R.layout.fragment1,container,false);
          list=(ListView)view.findViewById(R.id.listView1);
  
          ArrayAdapter adapter = ArrayAdapter.createFromResource(getActivity(),
                  R.array.chapters, android.R.layout.simple_list_item_1);
          list.setAdapter(adapter);
          list.setOnItemClickListener(this);
          return  view;
  
      }
  
      public void setcomunicatir (comunicatir comunicator)
      {
  
          this.com=comunicator;
      }
      @Override
      public void onItemClick(AdapterView&lt;?&gt; adapterView, View veiw, int i, long l) {
  
          com.respned(i);
  
      }
  
  
      public interface comunicatir
      {
          public void respned(int index);
  
      }
  }
  
      public class fragmentB  extends Fragment
  
  {
  
      TextView text;
      TextView textView2;
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
  
          View view = inflater.inflate(R.layout.fragment2, container, false);
          //text = (TextView) view.findViewById(R.id.textView1);
          //imgv=(ImageView) view.findViewById(R.id.imageView1);
          textView2 =(TextView)view.findViewById(R.id.textView22);
  
          return view;
  
      }
      public void cahngedata(int index)
      {
  
      /*String[] descrption =getResources().getStringArray(R.array.hadeith);
              text.setText(descrption[index]);*/
  
          String []Hadith=getResources().getStringArray(R.array.hadeith);
          //imgv.setImageResource(img[index]);
          textView2.setText(Hadith[index]);
  
          //int []descrption =getResources().getIntArray(img[index]);
          //  imgv.setImageResource(descrption[index]);       
  
              /*text.setText(descrption[index]);
          int arr[]=getResources().getIntArray(img[index]);
              imgv.setImageResource(arr[index]);*/
  
  
      }
  }
  
  
  
  public class AnotherActivity extends Activity
  
  {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.another);
  
          Intent intent = getIntent();
          int index= intent.getIntExtra("index", 0);
          fragmentB f2= (fragmentB)
                  getFragmentManager().
                          findFragmentById(R.id.fragment2);
          if (f2!=null)
              f2.cahngedata(index);
  
      }
  }
  </code></pre>
  
  <p>the Another Activity class also have error in picture 2</p>
  
  <p><a href="https://i.stack.imgur.com/zGWwb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zGWwb.png" alt="error 2"></a></p>