Android - <include layout = ... / "> returns an error
I have a library project in which I define the action bar in the action_bar.xml layout action_bar.xml as follows:
<?xml version="1.0" encoding="utf-8"?> <merge xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout style="@style/actionBar" /> </merge> Corresponding style element:
<style name="actionBar"> <item name="android:id">@id/action_bar_container</item> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">@dimen/title_height</item> <item name="android:orientation">horizontal</item> <item name="android:background">@drawable/action_bar_background</item> </style> When I try to include the action bar in another dashboard_activity_layout.xml layout file, as shown below:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/CustomTheme" android:id="@+id/activity_dashboard_root_container" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <include layout="@layout/action_bar"/> <LinearLayout android:orientation="vertical" android:id="@+id/fragment_container" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:padding="6dip"> </LinearLayout> </LinearLayout> He constantly throws an error:
You must specifiy a valid layout reference. The layout ID @layout/action_bar is not valid. Exception details are logged in Window > Show View > Error Log
I think this is a very simple problem and I am missing a small detail. Any help is appreciated. I adapted this from google input / output code. Is this related to the library project?
+4