Android Question AddMenuItem2 and Theme Holo

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I am running on a Samsung Galaxy Tab 3 with Android 4.4.2

If I have SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") in my Manifest

Then use AddMenuItem2 the ICON does not show up in the MenuItem

If I comment out the Holo theme then AddMenuItem2 works just fine the the ICON shows up on the menuitem.

If I do not use the Holo theme the compiler complains that I should have it.

How do I use the Holo theme and get the ICONs on the menuitems?

Is there an easy way for me to fix this problem?

Bob Valentino
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I saw a posting on the web for using a theme this way. SetApplicationAttribute(android:theme, "@android:style/Theme.DeviceDefault")

Now this seems to make the complier happy because I have a theme and the icons show up on the MenuItems

BUT... I am not sure how this will effect my App on other devices

Any help here would be appreciated.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You are talking about how many items you are using in the menu?
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Only have 3 menuitems

Tried AddMenuItem3 with Holo and still no icons.

Is there ANY draw back to using the DeviceDefault theme?

BobVal
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Tried AddMenuItem3 with Holo and still no icons
Make sure that the icons are small (24x24).

Is there ANY draw back to using the DeviceDefault theme?
If you set android:targetSdkVersion to 14 then the holo theme will be used by default.

The Android 2.x theme is an old theme. You shouldn't use it with Android 4 devices.
 
Upvote 0
Top