码迷,mamicode.com
首页 > 编程语言 > 详细

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

时间:2015-04-05 01:05:44      阅读:366      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!