My Android app is targeted to Android 3.1 and has a mode where a different menu is loaded on the action bar, with also a spinner and some buttons. I get the following error:
android.app.ActionBar$LayoutParams cannot be cast to com.android.internal.view.menu.ActionMenuView$LayoutParams
at com.android.internal.view.menu.ActionMenuView.onMeasure(ActionMenuView.java:116)
when the menu button is pressed to access certain further options that are not directly displayed on the action bar.
In onPrepareOptionsMenu there are normal instructions to get reference of the items and the spinner is set its LayoutParams. I think this instruction causes the error, doesn't it?
How this error can be solved?