Home Multiple resources in one APK
Reply: 0

Multiple resources in one APK

jelic98
1#
jelic98 Published in 2017-12-07 21:26:14Z

Knowing that changing resource values isn't possible, suppose I have two res subdirectories like drawable-one and drawable-two. Is it possible to switch between these dynamically (with Java)? At the moment I have two modules (one for each theme) that are overriding res directory from base module. I build these modules and get two APK's. The problem is I want to have two themes, but only one APK.

Example:

String theme = "two"

if(theme.equals("two")) {
    // use 'drawable-two' 
}else {
    // use 'drawable-one'
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.321241 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO