I am working on an application that uses a custom action bar layout referenced via android:actionBarStyle and android:customNavigationLayout in themes.xml . The panel has several elements, for example, a reset button and some information. On android 4 devices, these buttons can be found via findViewById (inside the action), but on android 3.2 findViewById returns null . Then it throws a NullPointerException.
Application uses ActionbarSherlock 4.2.0
Here is the .xml theme:
<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>
Activity:
@Override protected void onCreate(Bundle _savedInstanceState) { setContentView(...);
source share