(Refer to Baidu's code BaiduMapApi_ Lib_ Android_ 1.0.1. Zip, we finally have a clue. Prepare for inspection and share. It's also very simple. Now I will mainly talk about the problems I have encountered. My idea is simple. Customizing a component is a LinearLayout. The background is set to an image. The image path is: res/drawable/bg.png. It is implemented by issuing this. setBackgroundResource (R.drawable. bg). After the component is output as a jar according to the above steps, it is called by another app. It is found that the image cannot be output and the caller's tacit Icon is always displayed Decompiled Baidu Maps jar, and found that all its pictures were placed in assets, not res/drawable, and then checked the code. Its call to pictures was implemented through the AssetManager. open() method, not through R.drawble. This material includes the following attachments:
ComponentTest1\bin\com\eassol\componenttest1\ComponentTest1.class
ComponentTest1\bin\com\eassol\componenttest1\R$attr.class
ComponentTest1\bin\com\eassol\componenttest1\R$drawable.class
ComponentTest1\bin\com\eassol\componenttest1\R$id.class
ComponentTest1\bin\com\eassol\componenttest1\R$layout.class
ComponentTest1\bin\com\eassol\componenttest1\R$string.class
ComponentTest1\bin\com\eassol\componenttest1\R.class
ComponentTest1\bin\classes.dex
ComponentTest1\bin\ComponentTest1.apk
ComponentTest1\bin\resources.ap_
ComponentTest1\gen\com\eassol\componenttest1\R.java
ComponentTest1\libs\Component.jar
ComponentTest1\res\drawable-hdpi\icon.png
ComponentTest1\res\drawable-ldpi\icon.png
ComponentTest1\res\drawable-mdpi\icon.png
ComponentTest1\res\layout\main1.xml
ComponentTest1\res\values\strings.xml
ComponentTest1\src\com\eassol\componenttest1\ComponentTest1.java
ComponentTest1\.classpath
ComponentTest1\.project
ComponentTest1\AndroidManifest.xml
ComponentTest1\default.properties
ComponentTest1\proguard.cfg
.....)