Note that there are some explanatory texts on larger screens.

plurals
  1. POActionBarSherlock setCustomView not working in Android 3.2
    primarykey
    data
    text
    <p>I recently upgraded my application to use ActionBarSherlock 4.1. Since the upgrade users running the app on Honeycomb experiance a force close due to a null pointer exception when setting a custom view on the actionbar.</p> <p>I add a custom view containing two spinners to the actionbar this works on Android 4.0 &amp; 4.1 but is not working on 3.2.</p> <pre><code> bar.setCustomView(R.layout.custom_action_bar);// spinners actionBarViewHolder= new CustomActionBarViewHolder(); actionBarViewHolder.categorySpinner = (Spinner) findViewById(R.id.actionbar_catergory); actionBarViewHolder.sortBySpinner = (Spinner) findViewById(R.id.actionbar_sortby); </code></pre> <p>On Android 3.2 the spinners can not be found yet on 4.0 and 4.1 they views are found and anything runs smoothly. </p> <p>I have not tried the application on a 3.0 emulator but I image the problem persists.</p> <p>Any ideas what could be the problem?</p> <p> </p> <pre><code>&lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical|center_horizontal" android:layout_weight="0.5"&gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Category:" /&gt; &lt;Spinner android:id="@+id/actionbar_catergory" android:layout_width="wrap_content" android:layout_height="wrap_content" android:entries="@array/actionbar_spinner_catergory" android:background="@drawable/spinner_background" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/linearLayout1" android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center_vertical|center_horizontal" android:layout_weight="0.5"&gt; &lt;TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Sort By:" /&gt; &lt;Spinner android:id="@+id/actionbar_sortby" android:layout_width="wrap_content" android:layout_height="wrap_content" android:entries="@array/actionbar_spinner_sortby" android:background="@drawable/spinner_background" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload