好的,我现在才开始接触 Android 编程,我正在关注 android“TabActivity”教程:http: //developer.android.com/reference/android/app/TabActivity.html。一切正常,但似乎找不到某些支持类,请参阅下面生成错误的代码。
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);
对于 FragmentStackSupport/LoaderCursorSupport/LoaderCustomSupport/LoaderThrottleSupport,它表示所有这些都无法解析为一种类型。我已将最新的支持库添加到名为“libs”的根目录中的文件夹中,并将其复制到“C:/Eclipse/v4/”目录中。我的导入文件是:
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;
有人可以就如何解决这个问题给我一些建议,谢谢:)。