Tentando adicionar um fragmento ao meu contêiner de fragmento FrameLayout

Eu criei um arquivo xml chamado editor.xml que contém um FrameLayout. Na minha atividade principal, estou tentando adicionar meu fragmento personalizado ao meu FrameLayout.

O erro que recebo ao tentar adicionar meu fragmento é:

O método add (int, Fragment) no tipo FragmentTransaction não é aplicável para os argumentos (int, editorFrag)

No entanto meu editorFrag estende Fragment então estou confuso sobre o porquê isso está acontecendo. Abaixo está o meu código para os arquivos que mencionei. Qualquer ajuda é apreciada.

Editor.xml

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />

editorFrag.java

public class editorFrag extends Fragment
{
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, 
        Bundle savedInstanceState) 
    {

        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.newlevel, container, false);
    }
}

MainActivity.java

public class editorActivity extends FragmentActivity
{
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.editor);

        // Check that the activity is using the layout version with the fragment_container FrameLayout
        if(findViewById(R.id.fragment_container) != null)
        {
            // if we are being restored from a previous state, then we dont need to do anything and should
            // return or else we could end up with overlapping fragments.
            if(savedInstanceState != null)
                return;

            // Create an instance of editorFrag
            editorFrag firstFrag = new editorFrag();

            // add fragment to the fragment container layout
            getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, firstFrag);
        }
    } 
}

Respondidas:

Luksprog respondeu este problema para mim abaixo, dizendo-me para verificar minhas importações. O Eclipse escolheu importar a versão do SDK do Fragment em vez da versão de suporte que eu precisava. Obrigado pela ajuda.

questionAnswers(3)

yourAnswerToTheQuestion