-
-
Save ironhalik/e140d528653dadc9893d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyCoolFragment extends Fragment { | |
private Menu menu; | |
@Override | |
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { | |
inflater.inflate(R.menu.coolMenu, menu); | |
super.onCreateOptionsMenu(menu, inflater); | |
} | |
@Override | |
public void onPrepareOptionsMenu(Menu menu) { | |
this.menu = menu; | |
super.onPrepareOptionsMenu(menu); | |
} | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
final View rootView = inflater.inflate(R.layout.fragment_wirelessadb, container, false); | |
setHasOptionsMenu(true); | |
if(menu != null) { | |
System.out.println("Woo!"); | |
} else { | |
System.out.println("Nada."); | |
} | |
return rootView; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment