The question is clarifying. Fragments appeared in the 3rd version of the Android API 11, I am guided by users from API 15 and higher. So you do not need to use android.support.v4.app.Fragment
? This lib to support fragments in versions below 3, just the same?)
|
2 answers
If you want to use all the modern features of the fragments, fixes and the most identical behavior on different versions of the android, then it is better to use fragments and support libraries. The meaning of using native fragments is only if you have a rather small application and you want to make it extremely small). Today, even Android Studio itself by default, when creating a new project with activations and fragments, uses those of support.
|
Yes that's right. It turns out that if you want to use fragments and cover device versions lower than API11, then you need to use android.support.v4.app.Fragment.
If this is not necessary, use android.app.Fragment
- 2There is such a nuance that often the duplicate classes of support libraries are fixed with fixes that fix certain problems or additions, while this is not done for the main API. So in support.v4.Fragment, the last changes were made in July 2016 (and were done fairly regularly before), while basically the API of changes in the Fragment class didn’t seem to exist at all, although I didn’t check all the changelogs. Somewhere I met a recommendation to use classes from support libraries, since they are more relevant - pavlofff
- there is such a nuance and not only it - it can be tied in general to the link libraries. And it happens that at first it appears in one and then in the other, somewhere the deprc method and in the other it seems not, let alone docks and so on is a sore subject. As for the fragments as an example, this was the FragmentPagerAdapter, and a number of methods inside. - Shwarz Andrei
|