0

Possible Duplicate:
Android SDK Fragment Support

I tried to use Tabbed view using FragmentActivity. As I am developing for Android 2.3, I have used android-support-v4.jar to get Fragment related classes. I have followed the code described in TabActivity in Android developer's Guide. But I am facing problem to code used to tab in TabManager .

mTabManager.addTab(mTabHost.newTabSpec("simple").setIndicator("Simple"),
                FragmentStackSupport.CountingFragment.class, null);
        mTabManager.addTab(mTabHost.newTabSpec("contacts").setIndicator("Contacts"),
                LoaderCursorSupport.CursorLoaderListFragment.class, null);
        mTabManager.addTab(mTabHost.newTabSpec("custom").setIndicator("Custom"),
                LoaderCustomSupport.AppListFragment.class, null);
        mTabManager.addTab(mTabHost.newTabSpec("throttle").setIndicator("Throttle"),
                LoaderThrottleSupport.ThrottledLoaderListFragment.class, null);

None of the classes of FragmentStackSupport, LoaderCursorSupport, LoaderCustomSupport, LoaderThrottleSupport is available to import. Where is problem? I just want to set simple tab with text or image title. How to implement it?

Community
  • 1
  • 1
dev_android
  • 8,698
  • 22
  • 91
  • 148
  • 3
    This has already been answered here: http://stackoverflow.com/questions/8867134/android-sdk-fragment-support – kgiannakakis Oct 29 '12 at 10:07
  • If you start to work with the tabs in the compatibility library I'd recommend giving ActionBarSherlock a try. – Warpzit Oct 29 '12 at 12:48

1 Answers1

0

Thank u, kgiannakakis. Here is the solution:

Android SDK Fragment Support.

Those following classes are not part of the standard Android API (or the support library), but only exist in the support demos sample code for demonstration purposes. Anyone get the files in X:\Program Files\Android\android-sdk\extras\android\support\samples\Support4Demos\src\com\example\android\supportv4\app.

Community
  • 1
  • 1
dev_android
  • 8,698
  • 22
  • 91
  • 148