Я использую код из этого справочника.
Когда я вставляю этот код в свою программу, я получаю сообщение об ошибке, как показано на рисунке ниже. 
Есть причины ошибки? The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, ExampleFragments)
Код из моей основной деятельности:
public void red(View view) {
android.app.FragmentManager fragmentManager = getFragmentManager();
android.app.FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
ExampleFragments fragment = new ExampleFragments();
fragmentTransaction.replace(R.id.frag, fragment);
fragmentTransaction.commit();
}
ExampleFragments.java
package com.example.learn.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class ExampleFragments extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.blue_pill_frag, container, false);
}
}
Здесь:
package com.example.learn.fragments;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
ExampleFragmentsкласс? Я подозреваю, что это не расширяетFragment. - person Eric   schedule 24.07.2012ExampleFragments fragment = new ExampleFragments();, а неFragment fragment = new Fragment()? - person mattdonders   schedule 24.07.2012You can then add a fragment using the add() method, specifying the fragment to add and the view in which to insert it. For example:- person EGHDK   schedule 24.07.2012