Skip to content
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

插件化问题咨询 #1

Open
czhzero opened this issue Mar 25, 2017 · 1 comment
Open

插件化问题咨询 #1

czhzero opened this issue Mar 25, 2017 · 1 comment

Comments

@czhzero
Copy link

czhzero commented Mar 25, 2017

你好博主,看了你的项目代码,有些问题不是很明白。
1.如果主项目里面引用了Retrofit包,在插件应用里面,如何调用Retrofit的类和方法?
2.如果主项目里面想使用子项目的Fragment,有什么方法可以支持吗?
3.hook的时候,为什么对registerReceiver方法进行了hook,却没有对unregisterReceiver方法进行hook?
另外目前项目里面,只对标准activity,singleTask的activity,还有service做了支持,为什么对其他模式没有做处理?

@goeasyway
Copy link
Owner

Hi,

  1. 第一个问题,Retrofit可以放在Host应用里,插件APK打包时使用provided引用(只起编译作用,不作打包进插件APK中)。调用方式正常,如果不正常向我说一下,我空了也会进行这个测试。

  2. Fragment的创建其实很简单,处理两个问题,一个是如何选择类加载器去创建它的实例,二个是在Fragment的onCreateView之类的方法中能正确使用插件的Context.

  3. 不支持那么多,应为这是一个Demo应用,支持多了代码会相应复杂,增加初学者的难度。(我写的开源Demo的最大目的就是让有兴趣的人更方便的学会),其实学会了最基本的方式,其他的模式只要你会变通一下就会处理了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants