avdroidDev
avdroidDev

Reputation: 221

Two layouts for a single activity

Can i give two layouts for a single activity?? If yes, then how can i join them?? First layout should contain heading and the other one will be used in list adapter and repeated for every item in the list..

Thanks

Upvotes: 1

Views: 2793

Answers (2)

tbruyelle
tbruyelle

Reputation: 13035

You can have one layout for your Activity and use the following command to include a sub-layout :

<include android:layout="@layout/layout_name" />

Upvotes: 1

Vincent Mimoun-Prat
Vincent Mimoun-Prat

Reputation: 28541

I believe what you want to do is to have an activity layout containing the header and the list view. And on the other side, a row layout that will be used by a custom adapter for your list view.

Here is a short tutorial covering what you want to acheive: custom-listview-items-and-adapters

Upvotes: 0

Related Questions