Ok, I'm just starting to do Android programming now, and I follow the android "TabActivity" instructions: http://developer.android.com/reference/android/app/TabActivity.html , Everything that works, but cannot find some from the support classes, see below the code that generates errors.
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);
For FragmentStackSupport / LoaderCursorSupport / LoaderCustomSupport / LoaderThrottleSupport, he says that type cannot be allowed for all of them. I added the latest support library to a folder in the root directory named "libs", and also copied it to the directory "C: / Eclipse / v4 /". My import files:
import java.util.HashMap; import android.R; import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.support.v4.app.FragmentPagerAdapter; import android.view.View; import android.widget.TabHost; import cowdawg.hello_tab.namespace.R.layout; import cowdawg.hello_tab.namespace.R.id;
Can someone please offer me some tips on how to solve this, thanks :).
source share