Your fragments can contribute menu items to the activity's Options Menu (and, consequently, the Action Bar) by implementing onCreateOptionsMenu(). In order for this method to receive calls, however, you must call setHasOptionsMenu() during onCreate(), to indicate that the fragment would like to add items to the Options Menu (otherwise, the fragment will not receive a call to onCreateOptionsMenu()).
Ta tudo la na documentação do Android.
Lúcio Maciel
luciofm@gmail.com
Lúcio Maciel
luciofm@gmail.com
2011/10/24 André Luiz R. Silva <macolinkalkin@gmail.com>
Tenho que alterar o menu dentro de um fragment.Tentei usar onCreateOptionsMenu e onCreateContextMenu só que nenhum dos dois funcionou. A aplicação nem chama eles.Alguém já conseguiu alterar o menu no fragment?






0 comentários:
Postar um comentário