Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
2016-03-14 13:32
821 查看
NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first.
Exception raised during rendering: <include /> can only be used inside of a ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.wust.widget.PullToRefreshLayout (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F040002.
at android.content.res.BridgeResources.throwException(BridgeResources.java:693)
at android.content.res.BridgeResources.getAnimation(BridgeResources.java:305)
at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:71)
at com.wust.widget.PullToRefreshLayout.initView(PullToRefreshLayout.java:197)
at com.wust.widget.PullToRefreshLayout.<init>(PullToRefreshLayout.java:185)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0( at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:442)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:194)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:206)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:131)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:756)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:728)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:759)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:728)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:373)
不知道这样的问题大家遇到过没有,很烦,找了好多错误没有找到,最后还是加
if(!isInEditMode()){
//造成错误的代码段
}
才能解决问题。
虽然问题解决了,但是我觉得应该不是这样的错误
最开始我一直以为是style的问题,换了好多种都不行,因为在其他的项目中显示的非常正常,就只有style不同
Exception raised during rendering: <include /> can only be used inside of a ViewGroup
Exception details are logged in Window > Show View > Error Log
The following classes could not be instantiated:
- com.wust.widget.PullToRefreshLayout (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F040002.
at android.content.res.BridgeResources.throwException(BridgeResources.java:693)
at android.content.res.BridgeResources.getAnimation(BridgeResources.java:305)
at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:71)
at com.wust.widget.PullToRefreshLayout.initView(PullToRefreshLayout.java:197)
at com.wust.widget.PullToRefreshLayout.<init>(PullToRefreshLayout.java:185)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0( at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:442)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:194)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:206)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:131)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:756)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:728)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:759)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:728)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:373)
不知道这样的问题大家遇到过没有,很烦,找了好多错误没有找到,最后还是加
if(!isInEditMode()){
//造成错误的代码段
}
才能解决问题。
虽然问题解决了,但是我觉得应该不是这样的错误
最开始我一直以为是style的问题,换了好多种都不行,因为在其他的项目中显示的非常正常,就只有style不同
相关文章推荐
- Spring Web Flow 简介
- java文件读写操作大全
- 深入理解Java虚拟机引言
- 如何区分Java中的值传递和引用传递
- MessageDigest使用过程的一个记录
- eclipse 中如何取消断点
- Java中static关键字的作用
- H-Index | Java最短代码实现
- Spring Boot 系列 —— 简介
- java实现smtp邮件功能
- javac 及 java命令的使用问题(错误或无法加载主类)
- Spring中LocalSessionFactoryBean与SessionFactory
- Eclipse护眼背景色
- java jps命令
- Maven学习总结(七)——eclipse中使用Maven创建Web项目
- SpringMVC + MyBatis整合
- 深入理解Java虚拟机
- 一个简单的JSP+JavaBean web计算器
- Eclipse 常用快捷键
- Spark:用Scala和Java实现WordCount