天天看点

Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

今天在做自定义ViewGroup中,出现了一下错误提示

Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

具体解决方法:

在eclipse error log中查看错误具体出现在哪一行,然后将

if (isInEditMode()) { return; }加入即可。

这种方法同样适用于 xml布局文件中null错误。

java.lang.NullPointerException

Exception details are logged in Window > Show View > Error Log

继续阅读