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

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);

  

上一篇:ArrayList实现分组功能


下一篇:Mysql文件太大导入失败解决办法总结