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