Error Inflating Class Fragment Class Not Found Android.view.fragment But I Am Including The Compatability Library?
Solution 1:
Do the same in your layout XML:
<android.support.v4.app.Fragment />
Also, note the capitalization.
Solution 2:
Check if your activity extends FragmentActivity? android.support.v4.app.FragmentActivity to be exact...
Solution 3:
I've had a similar issue when using the fragment tag because I was missing the call to the super.onCreate() in my FragmentActivity. Adding it solved the problem:
protectedvoidonCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
Solution 4:
My SDK is 4.03 but device is 2.3.
I too had this problem. Then I got to know that when we are running on a lower version of the device,we need to include support jar (android.support.v4) in the build path.
After including the Jar into the Build path, we also need to make sure that the jar file will be at the Top of the ordering( using Order and Export option of the eclipse).
These two things solved my issue.. Hope it helps..
Solution 5:
I ran into the same issue and here is the solution.
The activity using your fragment needs to extend FragmentActivity
instead of just Activity
.
In your layout for the activity, you can still use <fragment />
instead of <android.support.v4.app.Fragment />
Post a Comment for "Error Inflating Class Fragment Class Not Found Android.view.fragment But I Am Including The Compatability Library?"