The question is how can I refer to id from include tag?
Let`s look at the example:
I have got such view that I want to reuse in many places:
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/first_el"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="Some txt 1" />
</merge>
Now I want to include this view and add some other view below like this:
<RelativeLayout>
<include layout="@layout/above_view"/>
<TextView
android:id="@+id/third_el"
android:layout_alignRight="@id/first_el"
android:layout_below="@id/first_el"
android:text="Some txt 2" />
</RelativeLayout>
In this case I receive error:
Description Resource Path Location Type error: Error:
No resource found that matches the given name (at 'layout_alignRight' with value '@id/first_el').
Regards