Android常见的问题总结
- NoFoundException解决办法:
原因:没有配置新建的activity,需要进行配置
2.java.lang.ClassCastException: android.widget.ImageView cannot be cast to android.widget.TextView解决办法
错误提示:
java.lang.ClassCastException: android.widget.ImageView cannot be cast to android.widget.TextView
出现原因:
xml中更改布局,替换了父viewGroup,比如说从当前LinearLayout移动到另一个RelativeLayout
解决办法:
检查一下之前有没有使用LayoutParams,如果有,将【原来ViewGroup】.LayoutParams改成【新viewGraoup】.LayoutParams
如果没有使用LayoutParams,移动xml布局后报这个错,可能是之前编译生成的.class文件与新的java内容冲突,
点击项目->clean。
3.报错:The directory C:\文件\ideaWorkSpace\seckill-master is registered as a Git root, but no Git repositories were found there.
原因:目录所示的git项目不存在,导致这个报错
解决方法:在as中的version contral选中不存在的项目删除即可:
file-setting-version control