1

I start develop application on Android! I need to show common control on the top of few screens. In Blackberry I just inherit my screens from base screen with needed controls and it inherit UI and behaviour from base type.

How can i do similar thing in Android? I mean, how can i organize it? Maybe, i need to create control or layout, which i can use on my screens? Or i need inherit one activity from another and use addContentView()?

What opportunities are there and what advantages / disadvantages of each?

Vlad Tsepelev
  • 2,056
  • 1
  • 21
  • 32

1 Answers1

5

Try the <include> XML layout directive.

Jakob
  • 383
  • 5
  • 15
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanx! But what with behaviour? Can I create my own "Control" with button with MessageBox, for example, and include this "Control" in my screens? – Vlad Tsepelev Jul 01 '10 at 12:57
  • You can create custom `View` classes if you wish. That is a somewhat complex topic, beyond the scope of a StackOverflow comment. FWIW, here is a project with a sample custom `View`: http://github.com/commonsguy/cw-advandroid/tree/master/Views/ColorMixer/ – CommonsWare Jul 01 '10 at 13:07