基于以下链接:
Best practice: Extending or overriding an Android library project class
https://developer.android.com/studio/write/add-resources.html#resource_merging
Android 库 (AAR) 中的类和资源是可覆盖的。覆盖 Assets 文件怎么样?在我的 AAR 文件中,我有一个名为 first.xml
的 Assets 。我想在我的 android 项目中创建我自己的 first.xml
来覆盖我的 AAR 中的文件。我该怎么做?
最佳答案
这是我的测试结果。
这是我在 AAR 中的 Assets /:
-assets/
-a.xml
-b.xml
这是我的 android 项目中的 Assets /,它依赖于上面的 AAR:
-assets/
-b.xml
-c.xml
我的 APK 中生成的 asset/如下:
-assets/
-a.xml (from AAR)
-b.xml (from my project)
-c.xml (from my project)
关于android - 覆盖 Android 库项目资源文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62115925/