android.view.inflateexception binary xml file line #1 error inflating class android.widget.relativeLayout

前端 未结 7 1273
春和景丽
春和景丽 2021-02-07 07:56

I am new in android.
I just made a new layout with one text bar and 2 buttons but it didn\'t work, I am posting the stack trace and my relative layout file any idea about th

7条回答
  •  北恋
    北恋 (楼主)
    2021-02-07 08:19

    I had the same problem - but in a activity that had no background image.

    I found out that the GUI editor (when using Eclipse - I don't know about Android Studio) sometimes adds the buggy property without any reason:

    android:background="@layout/activity_main"
    

    I'm not sure why the editor does so - maybe it is a bug or simply a usage error.

    However if the activity does not have a background image the entire property simply has to be deleted!

提交回复
热议问题