如何运行API级别的姜饼和更低的设备14演示 [英] How to run the api level 14 demos on gingerbread and lower devices
问题描述
当我从API级别14 Eclipse中创建一个新的Android示例项目,增加兼容性库,并尝试我的姜饼设备上运行它。它给了以下错误:
When I create a new Android Sample Project from eclipse with api level 14, add the compatibility library and try to run it on my gingerbread device. It gave the following error :
Error Inflating Class SwitchPreference
我只评论了切换preference
从preferences XML文件,并能够运行API演示应用程序。但是,<一个href=\"http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/index.html#Fragment\"相对=nofollow>片段(和其他几个)演示是不允许的。
I just commented the SwitchPreference
from the preferences xml file and was able to run the api demos app. But the Fragment(and few others) demos were not available.
时这正常吗?我应该运行API-14,以便能够看到片段演示装置?我缺少在创建项目的过程中什么?
Is this expected? should I have a device running api-14 to be able to see the Fragment demos? Am I missing anything in the process of creating the project?
任何帮助是AP preciated。
Any help is appreciated.
推荐答案
兼容性库提供的API片段,但它不以某种方式10设备升级API级别API 11或14的样本项目14 API可能使用其他API除此之外兼容性库不提供片段。此外,该命名空间是不同的。你必须做一些工作来港,如果你想在姜饼运行该样本回去。我想看看在样品中兼容性库,而不是
The compatibility library provides the Fragment API, but it doesn't somehow upgrade your API level 10 device to API 11 or 14. The sample projects for API 14 probably use other APIs besides fragments that the compatibility library does not provide. Additionally, the namespaces are different. You'll have to do some work to port that sample back if you want to run it on Gingerbread. I would look in the samples in the compatibility library instead.
这篇关于如何运行API级别的姜饼和更低的设备14演示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!