android.view.InflateException:二进制XML文件行#:错误类膨胀 [英] android.view.InflateException: Binary XML file line #: Error inflating class

查看:258
本文介绍了android.view.InflateException:二进制XML文件行#:错误类膨胀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的xml文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginBottom="10dp"
    android:orientation="horizontal">

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_marginTop="10dp"
        android:layout_weight="1"
        android:background="@drawable/filebinder" />

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="14"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="10dp"
            android:orientation="horizontal">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="6"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:text="30 July"
                    android:textColor="#03a9f4"
                    android:textSize="32sp" />

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

</LinearLayout>

我在Android监视器中得到这个

and i am getting this in my android monitor

07-01 18:32:04.693 10005-10005/com.mindefy.kidster E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.zze.zzb
07-01 18:32:12.293 10005-10005/com.mindefy.kidster E/AndroidRuntime: FATAL EXCEPTION: main
                                                                     java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mindefy.kidster/com.mindefy.kidster.DiaryEntry.diaryEntryTeacherActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class <unknown>

我是android的初学者,我已经阅读了各种相关问题的答案,但我仍然没有得到我错了。

I am a beginner in android and i had read answers of various related questions but still i am not getting it where i am wrong.

编辑1 - 删除了异常代码。

Edit 1 - Removed unusual code.

推荐答案

我认为问题出在您的 Drawable 图片中。 InflateException错误的常见问题是在尝试加载加载可绘制资源的imageview时出现内存不足异常。如果其中一个资源具有较高的像素分辨率,则需要大量内存才会导致膨胀异常。

I think the Problem is in your Drawable Image. The error InflateException is common issue is an out of memory exception when trying to inflate an imageview loading a drawable resource. If one of this resources has a high pixel resolution it would take a lot of memory causing then an inflate exception.

所以基本上验证drawables图像中的像素分辨率是只是布局所需的最低限度。

So basically verify that the pixel resolution in your drawables images are just the minimum necessary for your layout.

这篇关于android.view.InflateException:二进制XML文件行#:错误类膨胀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆