android编程异常解决 FATAL EXCEPTION: main android.view.InflateException: Binary XML file line #195: Erro

初学Android,碰到一个运行时错误,耽误了半天,错误如下

09-06 15:44:43.095: E/AndroidRuntime(7904): FATAL EXCEPTION: main
09-06 15:44:43.095: E/AndroidRuntime(7904): android.view.InflateException: Binary XML file line #195: Error inflating class com.bn.lccx.GGViewCX
09-06 15:44:43.095: E/AndroidRuntime(7904): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
09-06 15:44:43.095: E/AndroidRuntime(7904): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
09-06 15:44:43.095: E/AndroidRuntime(7904): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)

原因:我新建工程与源码名称不一致,源程序中使用了自定义样式,引用了路径,与现有路径不一样所致

解决办法:找到日志中的错误文件:Error inflating class com.bn.lccx.GGViewCX,把自动定义的GGViewCX.xml中的com.bn.lccx改为自己的,如work.tielu.GGViewCX,问题解决

posted @ 2014-09-06 16:02  星空天宇  阅读(87)  评论(0编辑  收藏  举报