I am a beginner to android applications and java, basically I am a PHP developer.
I\'ve a project for a tab+swipe application,
Yes, I got the output with these codes ,
In TabOne.java and TabTwo.java I've added
setHasOptionsMenu(true);
In onCreateView() function and after that menu function with different menu,removed menu function from main class.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState)
{
View view = inflater.inflate(R.layout.tab_a, container, false);
setHasOptionsMenu(true);
return view;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// TODO Auto-generated method stub
//super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.menu_b, menu);
}