This is not a duplicate of How can I use fragments, now that TabActivity is deprecated?
After some research the conclussion is that TabActivity is deprecated because we now have to use fragments. And the reason for that, as far I read, is that fragments work better with the action bar, and with the support compatibility library it's also possible to implement starting at Android 2.1
But I still don't really understand the reason why it's deprecated. Why not just make that the action bar also works with activities? Why are fragments prefered?
I also read fragments have better performance... is that the reason?
Activities at least are cleary separated entities which is something positive. I don't have enough insight in fragments now to understand why they are better.
Thanks in advance...
TabActivity has been deprecated, cause it is subclass of ActivityGroup, which also has been deprecated.
ActityGroup has been deprecated, and instead Fragment has been introduced and suggested. As using Fragments is easier and more flexible than ActivityGroup. It also enable android components to have a homogeneous pattern.
The main reason for which Google deprecate some methods / objects is to enforce best-practices and get the most homogeneous patterns accross applications.
Marking TabActivities as deprecated will make developpers use the ActionBar system for new applications, but you still can use TabActivities, although it's not encouraged.
Sometimes, They will mark something as deprecated for performance or because the behavior is not up to date with the latest API (for example the Clipboard system, changing from a "text only clipboard" to a "copy and paste anything".
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