1) 應用程式和皮膚程式的AndroidManifest.xml中配置
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package=""
android:versionCode="6"
android:versionName="0.8.8"
android:sharedUserId="com.timgor.skin">
2) 檔案與應用apk中對同一功能的皮膚檔案名稱要一致
3)訪問資源的方法
mXXX.getResourcesId(this, "activity_backgroud", "color")public int getResourcesId(Context context, String name, String type) {try {// 擷取皮膚共用的資料包String packageName = "com.timgor.tttt";Context skinContext = context.createPackageContext(packageName,Context.CONTEXT_IGNORE_SECURITY);int resID = skinContext.getResources().getIdentifier(name, type, packageName);if (resID > 0) {return skinContext.getResources().getColor(resID);}} catch (NameNotFoundException e) {e.printStackTrace();} catch (Exception e) {e.printStackTrace();}return context.getResources().getIdentifier(name, type, context.getPackageName());}