InflateException:Binary XML file line #105: Error inflating
项目在某些手机上偶尔会发生以下异常log: com.sogou.map.android.mapsncom.sogou.map.android.mapsnuncaught exception at Fri Apr 10 03:46:19 GMT+08:00 2015nandroid.view.InflateException: Binary XML file line #105: Error inflating class <unknown> android.view.LayoutInflater.createView(LayoutInflater.java:623) com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) android.view.LayoutInflater.onCreateView(LayoutInflater.java:672) android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)ntat android.view.LayoutInflater.rInflate(LayoutInflater.java:758) android.view.LayoutInflater.rInflate(LayoutInflater.java:761)ntat android.view.LayoutInflater.inflate(LayoutInflater.java:495) android.view.LayoutInflater.inflate(LayoutInflater.java:400)ntat android.view.LayoutInflater.inflate(LayoutInflater.java:353) android.view.View.inflate(View.java:17483)ntat
java代码中是通过View.inflate加载布局文件 布局文件xml文件对应105行是个系统的FrameLayout <FrameLayout
上网找资料找了好久,可能的情况是pic的图片太大,inflate时候造成VM内存溢出,inflate过程抛出InflateException 所以减小pic的大小 或者可以通过 try { view = View.inflate(context,R.layout.main,null); } catch (InflateException e) { System.gc(); view =View.inflate(context,null); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 从表中返回随机,无重复的行 – PostgreSQL
- Ruby – 将目录添加到$LOAD_PATH – 它是做什么的
- c# – 我可以在Visual Studio中为UnitTest / Loa
- c# – 为性能计数器安装Total实例
- 掌握Dojo工具包,第1部分:Dojo入门简介(1)
- Cocos2d-x 3.2编译生成Android程序出错的解决方案
- 当通过Lion上的Ajax运行时,PHP脚本会回显自己的内
- ruby-on-rails – 当我尝试使用Omniauth Google
- fackbook的Fresco的Image Pipeline以及自身的缓存
- ruby-on-rails – Moped :: Errors :: Operation