Android: Create Menu options in Fragments

To display menu options in fragment, we have to add 'setHasOptionsMenu' method in fragment onCreate().with out this method,menu options will not be visible in fragments.
public void onCreate(Bundle savedInstanceState) {

public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
  super.onCreateOptionsMenu(menu, inflater);
  inflater.inflate(, menu);

No comments:

Post a Comment