Issue
I have an activity that has custom menu items to launch, The problem is, when I hit the button for menu, the popup has a transparent background. I tried changing it to a ActionBarActivity over Activity, but it doesn't have an override-able onMenuItemSelected.
So, to get around that, I applied this to my styles.xml:
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="android:panelFullBackground">@drawable/customblackbox</item>
</style>
It didn't work, still have a transparent background. It's my only theme in the styles. Here's the custom black box xml that I created:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#151515"/>
<corners android:radius="0dp" />
<padding android:left="0dp" android:top="0dp"
android:right="0dp" android:bottom="0dp" />
<stroke android:color="#151515" android:width="1dp" />
</shape>
Why is the drawable not working?
EDIT:
Here is how I'm setting up my menu in my activity. The two IDs are just ints:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(0, EDIT_ID, 0, "Edit Fencer");
menu.add(0, DELETE_ID, 0, R.string.fencer_delete);
return true;
}
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
switch (item.getItemId()) {
case EDIT_ID:
//do other stuff
.
.
.
]
To be clear, this is what is happening when I hit the menu options:
Solution
In case anyone else needs an answer in the future:
What solved this for me was to change it to an actionBarActivity, and remove the action bar during onCreate. Nothing else seemed to work.
Answered By - Kat
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.