Hi Richard, thanks for the reply.

I have an app with light and dark themes defined in themes.xml.
I have a setting to allow the user the select light/dark theme in the app.
This works great.

Now the themes are pretty heavy in graphics, since they define not only 
styling but different drawables as well, so I want to offer more themes 
like blue, green, red, etc. as external apks in Google play, like I've seen 
many other apps have done, so a user could install a "MyApp blue theme" 
apk, and then he'll be able to choose this theme from the main app settings.

I've tried using: Resources res = pm.getResourcesForApplication(appInfo);
Which gets the resources object of the external apk, but I can't seem to 
get and apply the theme from it using activity.setTheme(externalTheme).

I've tried using: Context themedContext = 
activity.getApplicationContext().createPackageContext("com.myapp.blue", 
Context.CONTEXT_IGNORE_SECURITY);
Which gets a themed context, but again, couldn't set this theme to my 
running activity.

I've read a lot about this, but couldn't find any complete solution.

Thanks,
Mor.


On Thursday, August 2, 2012 12:17:40 AM UTC+3, RichardC wrote:
>
> If it's your own application then read about library projects.
> Otherwise unless the app you are reading resources from is available under 
> a suitable open source licence then in my opinion what you are trying to do 
> could be infringing copyright.
> If the app is open source then just download it and use the resources.
>
> On Thursday, April 5, 2012 6:51:58 PM UTC+1, Terry wrote:
>>
>> I'm able to use getResourcesForApplication and getIdentifier to get the 
>> individual resources from another application. However, when I try to call 
>> setTheme using a remote theme.xml from another app, the references inside 
>> theme.xml point to the app that I'm running, not pointing to the remote 
>> application where the theme.xml is. As a result, I get a 
>> ResourceNotFoundException inside theme.xml where I try to use the styles I 
>> defined from the remote app. In other words, I can apply theme.xml but not 
>> reference to the styles inside it.
>>
>> Moderator, please don't block this post. I googled for days and have not 
>> found a resolution to it.
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to