Android Question [SOLVED] Changing theme Appcompact when load app

scsjc

Well-Known Member
Licensed User
Longtime User
Hi, i need load the theme when start app, i see to launch theme in manifest :
B4X:
SetApplicationAttribute(android:theme, "@style/clasictheme")

is possible launch diferent theme depend of variable from program ??
i test to launch with:

B4X:
#if java
public void _onCreate() {
   if (_theme_value != 0)
     setTheme(_theme_value);
}

but... _onCreate() start before Activity_create
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

ivan.tellez

Active Member
Licensed User
Longtime User
But the effect is not nice. .. reload app ( first time with manifest theme and reload with changed theme )

Main could be an empty activity just with code to change theme and calling the reall Activity after the reload. Also you can change the transitions to avoid the reloading feeling
 
Last edited:
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
Main could be an empty activity just with code to change theme and calling the reall Activity afthere the reload. Also you can change the transitions to avoid the reloading feeling
Yes this idea is good... and i testing a simple solution ;)
 
Upvote 0
Top