PluginAppDemo icon indicating copy to clipboard operation
PluginAppDemo copied to clipboard

不支持自定义View?

Open jiashie opened this issue 7 years ago • 2 comments

简单地自定义一个CumstomTextView extends TextView,放到secondActivity的布局里。结果运行时崩溃, Caused by: android.view.InflateException: Binary XML file line #14: Binary XML file line #14: Error inflating class xu.otherapk.CumstomTextView Caused by: android.view.InflateException: Binary XML file line #14: Error inflating class xu.otherapk.CumstomTextView Caused by: java.lang.ClassNotFoundException: Didn't find class "xu.otherapk.CumstomTextView" on path: DexPathList[[zip file "/data/app/xu.pluginappdemo-1/base.apk"],

jiashie avatar Aug 16 '18 07:08 jiashie

重写这个方法即可

public class ProxyActivity extends FragmentActivity {

    private PluginInterface pluginInterface;

    @Override
    public ClassLoader getClassLoader() {
        return PluginManager.getInstance().getPluginDexClassLoader();
    }

zhangmingxingAtGit avatar Nov 23 '18 07:11 zhangmingxingAtGit

测试

kaina404 avatar Jun 20 '19 12:06 kaina404