0

I need some guidance.

I have some thing called advertise , header , content and footer. Just as you see in any website. When ever i create new activity I wish advertise , header and footer wont change. Only content changes. And all this three gets loaded when i initialize activity.

I dont want to use tabs. Please suggest how to proceed with this.

Any help is appreciated.

maxwells
  • 539
  • 4
  • 15

4 Answers4

0

You can create an external xml file for header and footer and use to add it to all layouts. Thus preventing from having duplicates.

Xeno Lupus
  • 1,504
  • 3
  • 12
  • 17
0

You can create seperate layout for header and footer and the you can just use the include tag in the layout file to include the header layout and footer layout.

include tag

Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242
0

you can view This

Here a list view is used but u can have a list view with just one row if required

Community
  • 1
  • 1
Shaireen
  • 3,703
  • 5
  • 28
  • 40
0

basically you have two ways of doing it:

  1. create footer / header layout files and include them in all your other layout files to removed duplicate code (multiple activities)
  2. create one layout that has the footer and header and the content in between and change the content layout on the fly ( using animations to make the transition prettier) depending on the state of your activity ( single activity )
P.Melch
  • 8,066
  • 43
  • 40