Skip to content Skip to sidebar Skip to footer

Android - Inflateexception: Binary Xml File Line #7

I was wondering, I have the following source code files: MainActivity.java package com.example.bmtitest2; import android.os.Bundle; import android.app.Activity; import android.app

Solution 1:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

    <com.example.bmtiTest2
    android:id="@+id/abstraction"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

</RelativeLayout>

What is the com.example.bmtiTest2? It is just your package name,but why is it here? If your defined your view(maybe com.example.bmtiTest2.MyView),the xml should be this:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >

    <com.example.bmtiTest2.MyView
    android:id="@+id/abstraction"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

</RelativeLayout>

Post a Comment for "Android - Inflateexception: Binary Xml File Line #7"