1:不用small 怎么获取资源
Resouces r = context.getResources();
获取字符串 r.getString(intValue);
获取图片 r.getDrawable(intValue);
2:怎么获取其它package包的资源
方法一:
Context otherContext = context.createPackageContext(otherPackageName , Context.CONTEXT_IGNORE_SECURITY)
Drawable result = otherContext.getResources.getIdentifier(context.getResources().getResourceName(resInt), "drawable",otherContext.getPackageName());
方法二:
通常用于跨进程获取另一个ap里面的资源
final PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo(resPackage, PackageManager.GET_UNINSTALLED_PACKAGES); pm.getResourcesForApplication(ai).getResources().getDrawable(getResId(), context.getTheme());
方法三:见small加载资源的方式
3: small加载资源的方式
关键步骤在assetPath
small中是如何做的:在插件加载完后的postSetup方法中
4:为什么不能加载插件中的资源
notification的加载流程
icon中的loaddrawable
如何支持:
stub模式
总结: