Show menu options on Toolbar for Activity contains Tabs as fragment
<p>I have an activity contains 3 tabs using fragment. I want to load/change the toolbar menu, when tab move.</p>

<pre><code>public class SpendsFragment extends Fragment {

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        menu.clear();
        MenuItem menuInicio = menu.add(0, 0, 0, "Início");
        menuInicio.setIcon(android.R.drawable.ic_menu_edit);

        MenuItem menuBusca = menu.add(1, 1, 0, "Buscar");
        menuBusca.setIcon(android.R.drawable.ic_menu_search);
        setHasOptionsMenu(true);
     super.onCreateOptionsMenu(menu, inflater);

   }
}

public class MoneyFragment extends Fragment {

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        menu.clear();
        MenuItem menuInicio = menu.add(0, 0, 0, "Edit");
        menuInicio.setIcon(R.drawable.xyz);

        MenuItem menuBusca = menu.add(1, 1, 0, "Delete");
        menuBusca.setIcon(R.drawable.abc);
        setHasOptionsMenu(true);
     super.onCreateOptionsMenu(menu, inflater);

   }
}
</code></pre>