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); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |