The difference between the use of the fragment in the app Pack and the fragment in the V4 package
1, try not to use the app package fragment, because this is after 3.0, the supported version is too high, in the lower version is not used
2, Android.support.v4.app.Fragment: can be compatible to 1.6 of the version,
3. Questions about the use <fragment> labeling of these two fragment
(1) Both App.fragment and v4.fragment are available with <fragment> tags.
Only in the use of the time if it is app.fragment there is no special place to inherit activity.
(2) When v4.fragment uses <fragment> tags, it should pay special attention to:
When the activity layout has a <fragment> tag, the activity must inherit
Fragmentactivity, or you'll get an error.
08-27 08:25:04.946:e/androidruntime (9839): caused By:java.lang.ClassCastException:com.example.android_fragment_ Bottom.fragments.TopBarFragment cannot is cast to Android.app.Fragment
At this point, if you do not B Ji Cheng fragmentactivity, the compilation system will think of <fragment> as the app package fragment to handle. But at this point we are importing the fragment in the V4 package.
An example of fragment in the official Android document is the fragment in the app package.
(3) The class and method of fragment in the app package have corresponding corresponding in the V4 package.
Can you see here Getsupportfragmentmanager (). The Getfragments () method disappears in the V4 package?
Http://www.eoeandroid.com/thread-328896-1-1.html
(Source: EoE Android Developer Community _android Development Forum)
The difference between the use of the fragment in the app Pack and the fragment in the V4 package