I have a problem. This code works fine on my nexus 10 android 4.2.1. But on AVD android 2.3 it gives me
NullPointerException com.example.training.ContentFragment.onCreateOptionsMenu(ContentFragment.java:97)
So I have two navigation tabs with two fragments each for one tabs.
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// Inflate the menu; this adds items to the action bar if it is present.
activity.getSupportMenuInflater().inflate(R.menu.trainings_menu, menu);
super.onCreateOptionsMenu(menu, inflater);
}
Can someone help me with this?
this method has already brought MenuInflater refference, you don’t need to call it, simply use provided one