onCreate Options菜单未在android 3.1中显示 [英] onCreate Options menu is not showing in android 3.1

查看:77
本文介绍了onCreate Options菜单未在android 3.1中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为平板电脑创建一个应用程序。我有一个偏好活动页面,该页面通过OnCreateOptions菜单进行调用。 oncreateoptins菜单不适用于android 3版本的平板电脑。为什么会这样,我使用了三星银河标签进行测试。当我在android 2.2的三星银河平板电脑的模拟器中运行同一个应用程序时,出现了oncreate options菜单,有人可以帮我吗

i am creating an app only for tablets. I have a preference activity page which i am calling through the OnCreateOptions Menu. The oncreateoptins menu is not working in tablets of android 3 version. Why it is so, i used a Samsung galaxy tab for my testing. When i run the same app in one of my emulator of Samsung galaxy tablet of android 2.2 i am getting the oncreate options menu, can anyone help me in this

推荐答案

我认为问题在于对选项菜单的不同处理。根据开发指南,在Android 3.x onCreateOptionsMenu()是在活动开始填充ActionBar时调用的,而不是在用户第一次触摸菜单按钮时调用的

I think problem is in different handling of options menu. According to dev guide, on Android 3.x onCreateOptionsMenu() is called when the activity starts to populate ActionBar, not when user touches the Menu button for the first time

这篇关于onCreate Options菜单未在android 3.1中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆