Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use views declared in one layout xml file in other layout

Tags:

android

Respected All, I am newly working on android technology. I have use map view which is declared in another layout.I have to display in some part of may screen. can I use same map view or i have to create new mapview programmatically. In short i have to display map in some part of my screen. How can i do it.. Thank You (Vikram Kadam)

like image 393
Vikram Avatar asked Jul 30 '10 09:07

Vikram


1 Answers

You need to use the tag <include> . From the google documentation :

<com.android.launcher.Workspace
android:id="@+id/workspace"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
launcher:defaultScreen="1">

<include android:id="@+id/cell1" layout="@layout/workspace_screen" />
<include android:id="@+id/cell2" layout="@layout/workspace_screen" />
<include android:id="@+id/cell3" layout="@layout/workspace_screen" />

</com.android.launcher.Workspace>  

You can find a full explanation in the documentation.

like image 110
Sephy Avatar answered Sep 23 '22 19:09

Sephy