Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android API TabActivity deprecation

Well, im developing and app for api 8 with TabActivity but i found out today that "This class is deprecated."

So we should use FragmentActivity from now to implements tabs? but what about when i want to show a listview with an activity? Do i have to use ListFragment (but this is "Since: API Level 11")

As anyone can see, im confuse about how to move on.

It would be great if someone can provide me good and clear concepts about this issues, tabs, fragment and any other useful advice (AsyncTaskLoader just for api11?)

btw, i was reading that fragment can be use since api 1 but now i can't find that. please help :(

edit: just re change the title cuz ListFragment wasn't deprecated. If i am not suppose to do that, plz sorry newby here :D

like image 975
Guillermo Varini Avatar asked Feb 23 '23 09:02

Guillermo Varini


2 Answers

Well, im developing and app for api 8 with TabActivity but i found out today that "This class is deprecated."

In Android, "deprecated" usually means "we will continue to maintain this as long as we can, but there are better options that you should consider". In the case of TabActivity, the long-term plan is for tabs to be in the action bar, which you can use on Android 3.x and higher, and on Android 2.x on down using something like ActionBarSherlock.

So we should use FragmentActivity from now to implements tabs?

Not necessarily, though it is certainly an option.

but what about when i want to show a listview with an activity? do i have t use ListFragment (but this is "Since: API Level 11")

ListFragment is also available in the Android Support package, the same place where you get FragmentActivity.

AsyncTaskLoader just for api11?

AsyncTaskLoader is also available in the Android Support package.

It would be great if someone can provide me good and clear concepts about this issues, tabs, fragment and any other useful advice

That would cover a couple of hundred pages in books. You might consider asking additional questions where you are more specific.

If you have not done so already, please read:

  • http://developer.android.com/guide/topics/fundamentals/fragments.html
  • http://android-developers.blogspot.com/2011/03/fragments-for-all.html
like image 198
CommonsWare Avatar answered Mar 08 '23 12:03

CommonsWare


You can use use android-support-v4.jar to use fragment in lower version

  • Fragments For All
  • Using Fragment of Android Compatibility Package
like image 42
Labeeb Panampullan Avatar answered Mar 08 '23 12:03

Labeeb Panampullan