Android-Android.view.InflateException:二进制XML文件行#2:膨胀类时出错<;未知>;
这是生成错误的XML文件。早些时候,它工作正常,但后来我修改了GUI,即这个XMl文件,没有更改任何核心代码,之后这个错误开始出现Android-Android.view.InflateException:二进制XML文件行#2:膨胀类时出错<;未知>;,android,Android,这是生成错误的XML文件。早些时候,它工作正常,但后来我修改了GUI,即这个XMl文件,没有更改任何核心代码,之后这个错误开始出现 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="matc
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/single_profile"
android:padding="10dp">
<TextView android:id="@+id/name_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="25dip"
android:textStyle="bold"
android:paddingTop="10dip"
android:paddingBottom="10dip"
android:textColor="#e600e5"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="180dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/picture_label"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_gravity="center"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<TextView android:id="@+id/email_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#e600e5"
android:gravity="right"
android:textStyle="bold"/>
<TextView android:id="@+id/artist_type_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#00b2b3"
android:gravity="right"/>
<TextView android:id="@+id/age_label"
android:layout_width="fill_parent"
android:textColor="#e600e5"
android:gravity="right"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/country_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#00b2b3"
android:gravity="right"/>
<TextView android:id="@+id/description_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#e600e5"
android:gravity="right"/>
<TextView android:id="@+id/phone_no_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="#00b2b3"
android:gravity="right"
android:textStyle="bold"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/like_label"
android:layout_width="114dp"
android:layout_height="38dp"
android:layout_weight="0.04"
android:textColor="#e600e5"
android:textStyle="bold" />
<Button
android:id="@+id/btn_like"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/like_bg" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/sms_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:background="@color/white"
android:layout_weight="1"
android:text="Send SMS"
android:textColor="#e600e5" />
<Button
android:id="@+id/call_label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:background="@color/white"
android:layout_weight="1"
android:text="Call"
android:textColor="#e600e5" />
</LinearLayout>
</LinearLayout>
发布完整的堆栈跟踪。但如果我不得不猜测的话,您的single\u profile
drawable导致了OutOfMemoryException。将图像缩小以修复此问题。请发布相关的java类too@laalto当然,这与内存无关,正如你看到的,他得到的是InflateException not OutOfMemoryException。如果你在drawable文件夹中有图像,在res文件夹中有colors.xml文件,那么InflateException就有嵌套的“起因”异常。