Android Question AddMenuItem2 and Theme Holo

Similar threads

B4A Code Snippet Theme Colors
Other B4A v5.80 BETA is released!
B4A Code Snippet Full Screen Theme
B4A Tutorial Make your app compatible with Android 5.0 devices
B4A Code Snippet Version safe themes

Robert Valentino

Well-Known Member
Licensed 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
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.
 

Robert Valentino

Well-Known Member
Licensed User
Only have 3 menuitems

Tried AddMenuItem3 with Holo and still no icons.

Is there ANY draw back to using the DeviceDefault theme?

BobVal
 

Erel

Administrator
Staff member
Licensed 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.
 
Top