Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8726693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:18:03+00:00 2026-06-13T08:18:03+00:00

When I try to add an ActionbarSherlock SearchView to my ActionBar the application crashes

  • 0

When I try to add an ActionbarSherlock SearchView to my ActionBar the application crashes as soon as the activity should be shown. As reason for this, I found the following in LogCat:

10-22 21:22:51.070: W/MenuInflater(21873): Cannot instantiate class: com.actionbarsherlock.widget.SearchView
...
10-22 21:22:51.070: W/MenuInflater(21873): Caused by: java.lang.reflect.InvocationTargetException
10-22 21:22:51.070: W/MenuInflater(21873):  at java.lang.reflect.Constructor.constructNative(Native Method)
10-22 21:22:51.070: W/MenuInflater(21873):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
10-22 21:22:51.070: W/MenuInflater(21873):  at android.view.LayoutInflater.createView(LayoutInflater.java:587)
10-22 21:22:51.070: W/MenuInflater(21873):  ... 32 more
10-22 21:22:51.070: W/MenuInflater(21873): Caused by: android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x7f01001f a=-1}
10-22 21:22:51.070: W/MenuInflater(21873):  at android.content.res.Resources.loadColorStateList(Resources.java:2035)
10-22 21:22:51.070: W/MenuInflater(21873):  at android.content.res.TypedArray.getColorStateList(TypedArray.java:342)
10-22 21:22:51.070: W/MenuInflater(21873):  at android.widget.TextView.<init>(TextView.java:768)
10-22 21:22:51.070: W/MenuInflater(21873):  at android.widget.TextView.<init>(TextView.java:442)

When I use the regular android.widget.SearchView for the android:actionViewClass everything works fine.
I followed the tutorial from the Android website.

This is my menu xml

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/menu_search"
        android:actionViewClass="com.actionbarsherlock.widget.SearchView"
        android:icon="@drawable/ic_action_search"
        android:showAsAction="ifRoom|collapseActionView"
        android:title="@string/menu_search"/>

    <item android:id="@+id/menu_add_page"
        android:title="@string/menu_add_page"
        android:icon="@drawable/ic_action_add"
        android:showAsAction="always" />

    <item android:id="@+id/menu_settings"
        android:title="@string/menu_settings"
        android:showAsAction="never" />
</menu>

And this is the relevant code:

public boolean onCreateOptionsMenu(Menu menu) {
    getSupportMenuInflater().inflate(R.menu.activity_overview, menu);

    // Get the SearchView and set the searchable configuration
    SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
    SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
    searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

    return true;
}

Is this a (known) bug, or am I missing something else here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:18:04+00:00Added an answer on June 13, 2026 at 8:18 am

    SearchView in ActionbarSherlock is / was a known issue. The dev branch contains the support, however it is not complete and seems they are still having issues with Suggestions.

    See github here and here for reference.

    Here is a link to the ActionBarSherlock > SearchView Source

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Getting this error when try to add an item to my repositories/context: Collection has
I try add and compile ffmpeg library in my own android application. When I
I have this error when I try add ace in class: Warning: PDO::quote() expects
I try add an event to blackberry calendar. The following code is used: EventList
My IDE crashes any time I try add a new component to the toolbar.
I try to add an addons system to my Windows.Net application using Reflection; but
This is the VBA code im using to try add a new sheet to
I try add example from http://ellislab.com/codeigniter/user_guide/tutorial/news_section.html to my site, this is code: news_model <?php
i try to add facebook like button on my root domain that will like
I try to add the android coverflow in my own android projet when myt

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.