Android TabHost

发布于 2024-09-13 20:49:22 字数 217 浏览 3 评论 0原文

我想做一个选项卡活动。 其中包含 3 个选项卡。 但是当我使用 Android 2.2 和 API 8 创建项目时,然后在 Main.XML 中显示空指针异常。 但是当我将其更改为 API 4 或 5 den 时,它显示选项卡的布局。

我想澄清的另一件事是,当我们创建项目时,我们需要指定构建目标和要在其上运行应用程序的 AVD。我想问一下这两个 API 是相同的还是可以不同?

提前致谢

I want to make an Tab Activity.
which consists of 3 tabs.
but when i create an project with Android 2.2 and API 8 then in Main.XML its showing an null pointer exception.
but when i change it to API 4 or 5 den it is showing the layout of tabs.

and one more thing i want to clarify is when we create an project we need to specify Build target and AVD on which we want to run application. i want to ask that both the API will be same or can be different??

Thanks in Advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜尕妞 2024-09-20 20:49:22

构建目标版本指定将启动哪个版本的 AVD 模拟器,除非该版本已经在运行。
SDK版本是为了兼容各个android版本。您可以保持 SDK 版本较低,例如 5 或 6,除非您使用旧版本中没有的特殊 API 代码。此外,您还可以将其部署到运行 Android 1.6 左右版本的设备的用户。
我的 Tab Activity 应用程序在 SDK 版本 4 及更高版本上运行,在我的模拟器上没有任何问题。然而,一些用户抱怨 2.2 上的 FC。

Build target version specifies which version of AVD emulator will be launched unless one is already running on that version.
SDK version is for compatibility with various android versions. You can keep the SDK version lower like 5 or 6 unless you are using special API code that is not found in older versions. Also that enables you to deploy to users of devices running on android version 1.6 or so.
I have apps with Tab Activity running on SDK versions 4 and up with no issues on my emulators. However some users are complaining about FC on 2.2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文