gpt4 book ai didi

Nexus 7 上未调用 Android Jellybean onCreateOptionsMenu

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:17:23 24 4
gpt4 key购买 nike

我有一个带有四个选项卡的 TabActivity。当我设置 android:targetSdkVersion="15"时,在 Nexus 7 上测试时,不会在任何选项卡 Activity 上调用 onCreateOptionsMenu 方法。

它与 android:targetSdkVersion="10"一起正常工作。

使用 android:targetSdkVersion="15"当 Activity 不在 TabActivity 中并且在手机上测试时 (Evo),它可以正常工作。

这是 onCreateOptionsMenu 的代码。

public boolean onCreateOptionsMenu(Menu menu) {
Log.i("Test","Base In create option menu");
if( menuId != null ) {
new MenuInflater(this).inflate(menuId,menu);
}
return super.onCreateOptionsMenu(menu);
}

最佳答案

抱歉,这很简单。根据谷歌:

http://developer.android.com/guide/topics/ui/menus.html

因此,如果您将目标 SDK 设置得较低,则可以显示已弃用的选项栏。对于较新的 SDK,您需要使用操作栏或其他形式的导航。基本上,Google 决定并非所有设备都有“菜单”按钮。

关于Nexus 7 上未调用 Android Jellybean onCreateOptionsMenu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13348213/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com