您的位置:首页 > 移动开发 > Android开发

android sdk<10的情况下,系统才会显示三个点的菜单~~

2012-08-05 01:58 357 查看
国外网站上找的:

For Android 3.0+, an efficient way to access my Preference activity would be by implementing the action bar

The action bar can be added by changing the theme to Theme.Holo, which is available on 3.0+ platforms

Since I have a phone with 2.2 on it, the Holo theme was not being found when I set it up in the manifest file, this was because my build target was 2.2

I initially changed the minSdkVersion to 11 in order for the theme to work, but that meant I wouldn't be able to test it on my phone and no one with a version of Android less than 3.0 would be able to use my app if they wanted to

The actual way to do it is by going into Project>Preferences>Android and setting the build target to the latest version of Android (this way, phones with higher OS versions can benefit from newer theme related changes, while the older versions remain unffected)

One thing to watch out for when setting a higher build target is the compatibility of classes you use. Some classes may only work on the higher versions of Android, and would therefore cause your app to crash on lower versions.

SDK>10的情况下,就不要去想使用三点菜单了!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐