
栏中有一些元素,如重载和一些信息按钮.
在androID 4设备上,这些按钮可以通过findVIEwByID(在活动内)找到,但在androID 3.2上,findVIEwByID返回null.这会抛出NullPointerException.
该应用程序正在使用ActionbarSherlock 4.2.0
这是themes.xml:
<style name="theme.SRF.tablet" parent="style/theme.Sherlock"> <item name="androID:windowContentOverlay">@drawable/header_shadow</item> <item name="androID:actionbarStyle">@style/TTTActionbar</item> </style> <style name="TTTActionbar" parent="style/Widget.Sherlock.Actionbar"> <item name="androID:background">@drawable/bg_header</item> <item name="androID:customNavigationLayout">@layout/actionbar_custom</item> </style>
活动:
@OverrIDe protected voID onCreate(Bundle _savedInstanceState) { setContentVIEw(...); // next line throws NullPointerException on androID 3.2 findVIEwByID(R.ID.actionbar_custom_bt_refresh).setonClickListener(mClickListener); .... }解决方法 我不知道这对你有帮助,但是从 here开始: 尝试添加:
<item name="customNavigationLayout">@layout/custom_action</item>
同意:
<item name="androID:customNavigationLayout">@layout/custom_action</item>总结
以上是内存溢出为你收集整理的find32ById在android 3.2上的 *** 作栏中搜索元素时返回null全部内容,希望文章能够帮你解决find32ById在android 3.2上的 *** 作栏中搜索元素时返回null所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)