I\'m trying to implement a PopupMenu with the Support V7 Library. All compiles fine but when I try to call:
PopupMenu popup = new PopupMenu(this, v);
Your layout file "abc_popup_menu_item_layout.xml" already shows a height defined.
Either "?attr/dropdownListPreferredItemHeight" is something from a different theme or library (such as ActionBarSherlock), or the error is coming from a different layout file.
Also, if you swap out "?attr/dropdownListPreferredItemHeight" for something like "60dp" does the error go away?
You might want to check if you have an appropriate theme specified in your manifest file:
<application ... android:theme="@style/Theme.AppCompat">
PopupMenu popup = new PopupMenu(this, v);
what's "this" refer to ? the first parameter must be a context like Activity, not ApplicationContext!!
Add this line to your Activity inside your manifest.xml
android:theme="@style/Theme.AppCompat"
Also check if there is another style that is applied within each activities in manifest.xml. This will override Theme.AppCompat in application tag.
@style/Theme.AppCompat.Light resovled the problem for me. @style/Theme.AppCompat is a dark theme, it deosn't fit my applicatoin.