I thought that it is impossible to access resources contained in other APK unless content providers are used. However, I stumbled upon an app called Better Keyboard. It uses
Try this
PathClassLoader loader =
new PathClassLoader ("/data/app/com.skin.apk", null,PathClassLoader.getSystemClassLoader());
InputStream f = loader.getResourceAsStream("res/drawable/icon.png");
Bitmap bitmap=BitmapFactory.decodeStream(f);
BitmapDrawable b=new BitmapDrawable(bitmap);
mButton.setBackgroundDrawable(b);