2013-10-28 15 views
0

我創建例如,對於自定義動作條在使用SetCustomview()的自定義動作條錯誤NullPointerException異常

現在我在Actionbar.setCustomView得到一個錯誤NullPointerException異常();

即時我的課我擴展集合任何人都可以幫助我嗎?

+1

是的,有什麼'null'.Please郵編和全堆棧跟蹤。 –

+0

@sᴜʀᴇsʜᴀᴛᴛᴀ[使用此鏈接代碼](https://github.com/Gupta126/code/blob/master/mainfile)在該行號碼96,我geting錯誤 –

回答

1

似乎getActionBar()返回null。

這兩個替換線60:

if(android.os.Build.VERSION.SDK_INT < 11) { 
    requestWindowFeature(Window.FEATURE_NO_TITLE); 
} 
+0

感謝您的回答我檢測到一個問題,你提供了再次感謝,但事情是,它可以顯示應用程序和標誌的標題,你可以告訴我爲什麼會發生這種情況? –

+0

當我第一次遇到這個問題時,我發現[this。](http://blog.perpetumdesign.com/2011/08/strange-case-of-dr-action-and-mr-bar.html)可能是幫幫我。 – ramaral

+0

謝謝你能檢查我這[問題](http://stackoverflow.com/questions/19654076/customise-actionbar-dont-show-title-of-app) –

相關問題