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 8314469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:49:42+00:00 2026-06-08T20:49:42+00:00

I have a collapsible menu item that is defined in XML like this: <item

  • 0

I have a collapsible menu item that is defined in XML like this:

<item
    android:id="@+id/searchMenu"
    android:icon="@android:drawable/ic_menu_search"
    android:showAsAction="withText|always|collapseActionView"
    android:actionLayout="@layout/collapsible_edittext"/>

Here’s the collapsible_edittext.xml file:

<?xml version="1.0" encoding="utf-8"?>
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:imeOptions="actionSearch"
android:inputType="text"
android:hint="@string/search"/>

When the item is expanded, and you change the orientation of the phone, it crashes giving this error in logcat:

07-24 08:59:19.353: E/AndroidRuntime(1284): Caused by: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.TextView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view’s id is id/searchMenu. Make sure other views do not use the same id.

If I remove the android:id=”@+id/searchMenu”, everything works fine but I need the item id in my code. This error only happens on ICS (It even works in the jelly bean emulator) and I’m using ActionBarSherlock 4.1.0

  • 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-08T20:49:43+00:00Added an answer on June 8, 2026 at 8:49 pm

    I finally found the problem, in fact it was not even linked with ActionBarSherlock (I removed action bar sherlock from my project and it was still crashing).

    I only needed to add an id to my EditText and that’s it.

    <?xml version="1.0" encoding="utf-8"?>
    <EditText xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/collapsibleEditText"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:imeOptions="actionSearch"
        android:inputType="text"
        android:hint="@string/search"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a collapsible content like this http://jsfiddle.net/coderslay/Ae5CU/ In that the Summary is aligned
I have a jQuery Mobile accordion menu set up like: <div class=subCat data-role=collapsible> <h3
I have a jQuery Mobile accordion menu set up like: <div class=subCat data-role=collapsible> <h3>Subcategory
I have a panel defined like this: var msgDetailsPanel = new Ext.ux.ManagedIFrame.Panel({ title: 'M',
I have a page with multiple collapsible sections, like this: Persona Impresa News I
Is it possible to have a collapsible menu in a fragment, say for example...
I have a sidebar with collapsible menu it works fine but all the values
I have the following jquery mobile code: <div data-role=collapsible> <h3>I like to read a
I have a simple collapsible content element at the top of a page that
I have a set of divs that I want to make collapsible/expandable using jQuery's

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.