今天在做自定義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