-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
插件里ContentProvider不能使用 #253
Comments
目前插件manifest只支持注册 |
@galenlin 那以后有没计划支持插件里注册content provider? |
不会做到 |
@galenlin 因为android studio可以在依赖的module声明provider的, |
@kkmike999 现在的问题是运行时的处理,动态注册Provider需要增加一系列的hook操作。会带来一些成本,根据二八原则,框架应该集中精力满足80%的需求,并做到极致。 所以目前我的建议是在宿主的manifest去注册你的Provider就可以了,代码实现可以放到插件里。 |
@galenlin 请问在宿主如何注册插件的Provider?因为Provider代码写在插件,所以app/AndroidManifest.xml不能引用插件Provider.
运行时报错:
|
从你的log来看,插件没有被加载:
如果有插件,这里的DexPathList不只一个的。 |
@galenlin 我在SmappApp的 不过我找到了动态加载Provider的方法:
我觉得Small应该提供动态注册provider方法,只要提供provider packageName+className。 |
目录结构
app.main2配置了
ContentProvider
在app.main2的
MainActivity2
获取不到ContentProvider
我本来想在app.main和宿主获取app.main2配置的
ContentProvider
的,用于解决插件间通讯问题。不知道以后Small能不能支持?@galenlin
The text was updated successfully, but these errors were encountered: