Since I've been using my code, I used fragments.
To do so, I have an activity calling a fragment using a fragment by tag :
FluxListFragment FLF = (FluxListFragment) getFragmentManager().findFragmentByTag(FRAG_LIST);
But since today, getFragmentManager seems to be unrecognized. It says :
"The method getFragmentManager() is undefined for the type FluxMainActivity"
Is the problem coming from the build target ? (I put Android 3.0)
Here is the code :
public Class FluxMainActivity extends Activity {
@override
public void onCreate(Bundle saveInstanceState)
{
super.onCreate();
setContentView(R.layout.main);
FluxListeFragment FLF = (FluxListeFragment)getFragmentManager().findFragmentByTag(FRAG_LISTE);
}
}
The method should be linked to FluxListeFragment and not FluxMainActivity ! I think the cast is incorrect.
The method (methodName) undefined for the type (className) Specific errors The method contains(String) is undefined for the type String The method codePointAt(String) is undefined for the type String
The method getResources() is undefined for the type The method getSystemService(String) is undefined for the type List Problem This error message appears in java when the method is not defined in that class.
This tutorial demonstrates Java’s the method is undefined for the type error. The error the method is undefined for the type occurs whenever we try to call a method that is not defined in the current class. An example throws the the method is undefined for the type error.
The method format(String) is undefined for the type String The method getTypeParameters(typeVariable) is undefined for the type typeVariable
Problem solved.
The project target was in API 11, but it contained 2 libraries with one of them in target API 8.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With