How to load resource from another package in xml?

DeathlyRanch

New Member
I know that exists ability to install resource xml file from another package in code like this:\[code\]String resourceName = getResources().getResourceEntryName(layoutResID);String resourceTypeName = getResources().getResourceTypeName(layoutResID);Resources skinResources = getResourcesForPackage("com.my.skin");int skinResourceId = skinResources.getIdentifier(resourceName, resourceTypeName, "com.my.skin");mLayoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);mLayoutInflater.inflate(skinResources.getXml(skinResourceId), null);super.setContentView(mLayoutInflater.inflate(skinResources.getXml(skinResourceId), null));\[/code\]But i would like to know how to make the same but in xml and for drawable resources:For example: I have two applications:
  • application main with package "com.my.main"
  • and application skin with package "com.my.skin"
In android docs explained:\[quote\] May be a reference to another resource, in the form "@[+][package:]type:name" or to a theme attribute in the form "?[package:][type:]name".\[/quote\]I have tried to specify something like this: \[code\]android:background="@com.my.skin:drawable:background_image"\[/code\]or this:\[code\]android:background="?com.my.skin:drawable:background_image"\[/code\]but it not work, my resource file not compiled. Who know how to load resource using explicit specification.
 
Back
Top