Speaking of inclusion, you either have an identifier in the root representation inside the included layout file, or in the inclusion string, and not both. For example:
<include layout="@layout/layout1" android:id="@+id/layout1"/>
Layout 1 file
<RelativeLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/layout2"> </RelativeLayout>
The above example is incorrect, because technically you have two id declared for one layout. So, you need to choose which element will have the identifier.
mossman252 Nov 23 '16 at 17:29 2016-11-23 17:29
source share