1

How to add a header to an existing android activity? All the examples that I found with a search engine are showing how to add a header to the list view.

Samet ÖZTOPRAK
  • 3,112
  • 3
  • 32
  • 33
ssk
  • 9,045
  • 26
  • 96
  • 169
  • Your question is not really specific enough. I assume the Activity will be a View or View subclass. The method of adding a "header" depends on which View you are using. – Dennis Sheil Nov 07 '11 at 05:49
  • 1
    Need more description what do you mean by "add a header to an existing android activity?" – Paresh Mayani Nov 07 '11 at 06:01

3 Answers3

1

I don't know what you are looking for..might be this answer is useful to you.

Community
  • 1
  • 1
MKJParekh
  • 34,073
  • 11
  • 87
  • 98
0

You have to add a view the xml that you're using for your layout. So for example, say your Activity is using a linear layout. You'd do:

<LinearLayout android:orientation="vertical" ....>
  <LinearLayout....>
     <!---- Header Stuff Goes Here ---->
  </LinearLayout>
  <!--- Rest of the layout for your activity goes here ---->
</LinearLayout>
Kurtis Nusbaum
  • 30,445
  • 13
  • 78
  • 102
0

What you are looking for is a ActionBar, it is included on 3.0 api but if you want to use with backward compatibility you can use different libraries, my preferit is GreenDroid you can also see an example downloading the GreenDroid Catalog App from Market.

I hope this helped you :)

Jordi Coscolla
  • 1,066
  • 6
  • 8