I have my custom ConfigActivity
which extends PreferenceActivity (from android.preference.PreferenceActivity
). The layout for this activity contains a <ListView android:id="@android:id/list"...
. Inside this layout, I need to programmatically add/replace a couple of other Fragments I have created that extend android.support.v4.app.Fragment
.
However, Eclipse says:
The method getSupportFragmentManager() is undefined for the type ConfigActivity
.
I tried replacing it for just getFragmentManager()
, but the following call:
ft.add(R.id.fHeader, new MyCustomFragment());
results in the following error:
The method add(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyCustomFragment)
Is my only option to NOT use my custom Fragments that extends the support library's Fragment class inside ConfigActivity?