Android Tutorial Make your app compatible with Android 5.0 devices

hmotiwala

Member
Licensed User
Longtime 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.
 

Douglas Farias

Expert
Licensed User
Longtime User
holo.light go work too erel? i dont have the 5.0 to test =(
 

drgottjr

Expert
Licensed User
Longtime User


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
Longtime User

corwin42

Expert
Licensed User
Longtime User

If you set a holo theme the application icon should show.
 

drgottjr

Expert
Licensed User
Longtime 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
Longtime User

pesquera

Active Member
Licensed User
Longtime 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
Longtime 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.
 

tagwato

Member
Licensed User
Longtime User
You can disable the animation by setting Animation Duration property to 0 (in the designer).

You can change the activity background color to remove the gradient.

Thanks, Erel. It works.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…