1

My android app has several screens, and in each one of them I would like to have a similar options menu with a slight different.

For example screen A would have items 1,2,3,4 and screen B would have items 1,3,4,5

As you see they have items in common which make it stupid to have a different xml menu for each one, because I will have to define the items again and again.

Is there a smart way of doing that?

Filburt
  • 17,626
  • 12
  • 64
  • 115
yogi
  • 1,327
  • 2
  • 12
  • 33

1 Answers1

0

you could try to use this code in your various layouts

<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/your_layout_with_options" />

where your_layout_with_options is an xml file containing all your options.

so you have always the same identifiers in your screens and you can chose witch items to show and witch items to hide..

hope this help

Apperside
  • 3,542
  • 2
  • 38
  • 65