Android Tutorial Make your app compatible with Android 5.0 devices

hmotiwala

Member
Licensed User
For that I will have to wait till I get android 5.0 update on one of my devices. This behavior is reported to me by some users who have nexus 5 with Lollipop. The application runs just fine on my device with kitkat on it. I was just posting here to see if anyone else has seen similar behavior and may be there was a known fix for it.
I will put this issue on hold for now, till I am able to test on android 5.0 myself.
 

drgottjr

Well-Known Member
Licensed User
If you set this theme directly you have to change the minSdkVersion to 11 since Theme.Holo is introduced in API Level 11 and is not available in previous Android versions.

If you want to still support older android versions use the method in this tutorial: http://www.basic4ppc.com/android/forum/threads/theme-based-on-version-tutorial.27624/#content

i added SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") to the manifest and set minSdkVersion = 11,
and there is still no bitmap in msgbox2 on my android 5.0.1 device. is there anything else that should be set? thanks.
-go
 

corwin42

Expert
Licensed User

corwin42

Expert
Licensed User
re lollipop issues: i noticed that the little icon/image that use to appear next to the app's title is no longer there.
i've added SetApplicationAttribute(android:theme, "@android:style/Theme.Holo") to the manifest
i've set minskd = 11
i'm compiling with b4a 4.0
(above behavior is in addition to msgbox2 still not showing bitmap)

anything else needed? thanks.
-go
If you set a holo theme the application icon should show.
 

drgottjr

Well-Known Member
Licensed User
If you set a holo theme the application icon should show.
you're right. i did set the holo theme and the minsdk, but there were a couple things you mentioned in a different post which, when done, seemed to do the trick. i have the icon application back, but, as erel has mentioned elsewhere, the icon in msgbox2 will not appear. my real concern, of course, is that something major will fail under lollipop. setting the holo theme, the minsdk and the target seems to cover the bases. i've even included the themes.xml you mentioned (in a slightly different context). it doesn't appear to hurt. my apps all appear to function under lollipop, but i didn't start looking closely at ui until i noticed the slight differences between my 4.x device and the recently upgraded 5.0 device. thanks for a major help.
-go
 

corwin42

Expert
Licensed User

pesquera

Active Member
Licensed User
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")
Hi Erel, doing this was perfect for me but.. on an old device (Android 2.3.6) the labels don't show multiline.. just they show the first line
I solved this changing the view from Label to EditText with the propertia SingleLine=False and Enabled=false
The problem is that I must change many labels on this way.. is there some trick to solve this better? (I like this theme)
thanks!
 

tagwato

Member
Licensed User
Hello,

Setting Theme.Holo as explained here does improve apps compatibibility with android 5.

But this workaround has some drawbacks, at least for me: a) the above theme adds an animation when loading layouts; b) also, a kind of gradient color is shown in the background of the activity and panels.

Question: is there a way to inhibit these two behaviours of Theme.Holo? Or, is there any other Android 5 compatible theme which doesn't show these behaviours? I'd like especially to get rid of that animation feature.
 
Top