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

posted @ 2014-08-04 10:53  西北野狼  阅读(2525)  评论(0编辑  收藏  举报