Android插件化
AlexeyElijah
这个作者很懒,什么都没留下…
展开
-
插件化开发 - LayoutInflate2。源码解析
之前解决了自定义LayoutInflate问题,使用自定义的LayoutInflate.inflate可以得到插件资源。1.layout1.LayoutInflate解析。//当root传入null时候,attachToRoot自动是false414 public View inflate(@LayoutRes int resource, @Nullable ViewGroup root...原创 2019-09-03 10:22:57 · 164 阅读 · 0 评论 -
插件化开发 - LayoutInflate1。插件资源问题
我们采用插件和宿主context隔离方式,在插件Activity中传入插件的 application context,与宿主activity。插件中使用LayoutInflate.from(context).inflate(R.layout.xxxx)来创建view。这时候出现几个问题:1.插件Activity的setContent方法不能直接调用宿主hostActivity.setCote...原创 2019-09-03 10:47:48 · 292 阅读 · 0 评论 -
插件化开发 - LayoutInflate3。插件中LayoutInflate.from(pluginContext)问题
插件中使用LayoutInflate.from(pluginContext),实际是调用了 context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);首先是调用contextImpl的getSystemService,这里面调用SystemServiceRegistry.getSystemService。第一个参数是contextImpl...原创 2019-09-03 11:24:05 · 268 阅读 · 0 评论 -
RequestWindowFeature问题。7.0以下手机要注意。
大家都知道Activity中的requestWindowFeature需要在setContent前调用,否者会抛异常:AndroidRuntimeException(“requestFeature() must be called before adding content”)在一部7.1.1手机上插件化时发现,即使在setContent前调用,也会抛出此异常。分析下源码。Activi...原创 2019-09-05 11:11:22 · 292 阅读 · 0 评论