Android Question [SOLVED] Creating themes for many Android versions ?

lemonisdead

Well-Known Member
Licensed User
Longtime User
Hello,
I am referring to this post : https://www.b4x.com/android/forum/threads/custom-theme-error.65955/#post-417610

Erel proposes a way to create themes at compilation for "both Android 4 and Android 5+". My question is : how could I be sure to handle all android's versions ?
Shouldn't I create a default "value" ?

I am asking this because I have got error reports with some Samsung devices running KitKat (API 19) and which used the theme I did create for Lollipop+
Thanks


B4X:
SetApplicationAttribute(android:theme, "@style/AppTheme")
CreateResource(values-v21, theme.xml,
<resources>
  <style name="AppTheme" parent="android:Theme.Material">
  <item name="android:colorPrimary">#3e3e41</item>
  <item name="android:colorPrimaryDark">#2d2d30</item>
  <item name="android:colorAccent">#ebece8</item>
  </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
  <style name="AppTheme" parent="@android:style/Theme.Holo.Light">
  </style>
</resources>
)
 
Last edited:

lemonisdead

Well-Known Member
Licensed User
Longtime User
Thanks Erel. I just (sorry for the delay I took), so I just understood that B4A was able to manage all the Android's specifications (in fact I now see it more like an IDE than a language based software)... I feel stupid
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…