Android的兼容性包 [英] Android Compatibility Package
问题描述
努力让自己在低于11 SDK中的片段例子的工作,我得到了一个错误
Trying to make the Fragments example work on lower than 11 SDK, I get an error in
setListAdapter(new ArrayAdapter<String>(getActivity(),
android.R.layout.simple_list_item_activated_1, Shakespeare.TITLES));
说:simple_list_item_activated_1不能得到解决或不是场,在进口我有
saying "simple_list_item_activated_1" cannot be resolved or is not a field". In import i have
import com.example.android.apis.R;
import com.example.android.apis.Shakespeare;
什么是错在这里?
What wrong is in here?
推荐答案
如果你想使用较早版本的Android这个资源,把它复制了你的SDK,并为您的项目资源是一个新的API级别11,然后引用您的项目,本地副本。请注意,您可能需要进行其他调整此布局文件,因为我认为它会参考一些新的风格属性,而这种不早期版本的Android的存在。
That resource is new to API Level 11. If you want to use that resource on earlier versions of Android, copy it out of your SDK and into your project, then reference your project-local copy. Note that you may need to make other adjustments to this layout file, as I think it will refer to some new style attributes and such that do not exist in earlier versions of Android.
这篇关于Android的兼容性包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!