3

I'm trying to create an application using the Master/Detail Flow template provided by Android, and I'm trying to add multiple actionbar menu items to both the master and detail portions of the actionbar. This is what I'm trying to accomplish:

Gmail on iPad
(source: softwarecrew.com)

Trying to add the menu items through the fragments themselves doesn't seem to work, is it even possible?

Community
  • 1
  • 1
Sander
  • 1,183
  • 12
  • 27

1 Answers1

4

All Action Bar icons appear on the right hand side - they would not be aligned with your master or detail pane. Per the Fragments guide on adding items to the Action Bar:

you must call setHasOptionsMenu() during onCreate() to indicate that the fragment would like to add items to the Options Menu

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443