4

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

pata
  • 959
  • 2
  • 18
  • 35

3 Answers3

6

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:

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • so ActionBarSherlock simulates a actionBar of 3.x in lower api's and have the same usage of tab bar, right? – pata Nov 15 '11 at 18:24
2

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

Labeeb Panampullan
  • 34,521
  • 28
  • 94
  • 112
  • ok, that wht i saw that .jar before. i tried to implement some samples but i got problem with R class. That have changed? – pata Nov 15 '11 at 18:12
  • "_i got problem with R class_" actually R.java is a **AUTO-GENERATED FILE**. Hope a clean build will solve your problem – Labeeb Panampullan Nov 16 '11 at 04:23
  • but when i import the sample from that .jar my R class is erase from project and in need to import com.example.android.supportv4.R but cant find that class... need further research to understand this – pata Nov 16 '11 at 12:44
  • did you added that jar to your project build path? – Labeeb Panampullan Nov 16 '11 at 13:06
0

Fragments have a support package all the way back to API 4.

API 4 Reference

prolink007
  • 33,872
  • 24
  • 117
  • 185