2. main.xml
<menu xmlns:android="http://www.easck.com/apk/res/android" >
<item
android:id="@+id/action_search"
android:orderInCategory="100"
android:actionViewClass="android.widget.SearchView"
android:showAsAction="always"
android:title="@string/it_search"/>
<item
android:id="@+id/action_custom_layout"
android:actionLayout="@layout/my_layout"
android:orderInCategory="100"
android:icon="@drawable/ic_launcher"
android:showAsAction="always|collapseActionView"
android:title="layout"/>
</menu>
3. activity_main.xml
<RelativeLayout xmlns:android="http://www.easck.com/apk/res/android"
xmlns:tools="http://www.easck.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/txtResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>
4. my_layout.xml
<RelativeLayout xmlns:android="http://www.easck.com/apk/res/android"
xmlns:tools="http://www.easck.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<AnalogClock
android:id="@+id/acClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>










