首页 > 编程语言 > 详细

getActionBar().setTitle(); Java.lang.NullPoint异常解决方案

时间:2015-04-05 01:04:40      阅读:553      评论:0      收藏:0      [点我收藏+]

getActionBar().setTitle(); Java.lang.NullPoint异常解决方案,是由于低版本不支持直接获取的缘故,修改方案:

 

try changing your theme to this

<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">

and not the AppCompat Version

  

另外一种情况,如果是低版本,API低于11的解决方案:

 

It basically depends on whch api you are targeting.If it less than 14 use
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
and in your activity call your actionbar using this

getSupportActionBar().setDisplayHomeAsUpEnabled(true);

  

getActionBar().setTitle(); Java.lang.NullPoint异常解决方案

原文:http://www.cnblogs.com/spring87/p/4393275.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!