Fragment onCreateOptionsMenu - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment onCreateOptionsMenu method.

This code example shows how to use the following methods:onCreateOptionsMenu
        super.onDetach(); 
    } 
 
    @Override 
    public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
        onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
    } 
 
    @Override 
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        //Nothing to see here. 
    } 
 
    @Override 
    public final void onPrepareOptionsMenu(android.view.Menu menu) {
        onPrepareOptionsMenu(new MenuWrapper(menu));
    } 
 
    @Override 
    public void onPrepareOptionsMenu(Menu menu) {
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onCreateOptionsMenu
        super.onDetach(); 
    } 
 
    @Override 
    public final void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
        onCreateOptionsMenu(new MenuWrapper(menu), mActivity.getSupportMenuInflater());
    } 
 
    @Override 
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        //Nothing to see here. 
    } 
 
    @Override 
    public final void onPrepareOptionsMenu(android.view.Menu menu) {
        onPrepareOptionsMenu(new MenuWrapper(menu));
    } 
 
    @Override 
    public void onPrepareOptionsMenu(Menu menu) {
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onCreateOptionsMenu
 
        @Override 
        public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
            MenuItemCompat.setShowAsAction(menu.add("Menu 1a"), MenuItem.SHOW_AS_ACTION_IF_ROOM);
            MenuItemCompat.setShowAsAction(menu.add("Menu 1b"), MenuItem.SHOW_AS_ACTION_IF_ROOM);
            super.onCreateOptionsMenu(menu, inflater);
        } 
 
        @Override 
        public boolean onOptionsItemSelected(MenuItem item) {
            if (item.getTitle().equals("Menu 1a")) {
                Toast.makeText(getActivity(), "Selected Menu 1a.", Toast.LENGTH_SHORT).show();
                return true; 
            } 
            if (item.getTitle().equals("Menu 1b")) {
                Toast.makeText(getActivity(), "Selected Menu 1b.", Toast.LENGTH_SHORT).show();
                return true; 
            } 
            return super.onOptionsItemSelected(item);
        } 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onCreateOptionsMenu
 
	@Override 
	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
		 
		 
		super.onCreateOptionsMenu(menu, inflater);
		 
		 
		 
	} 
 
	@Override 
	public void onPrepareOptionsMenu(Menu menu) {
		 
		 
		super.onPrepareOptionsMenu(menu);
		 
		 
		 
		 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:onCreateOptionsMenu
 
 
    @Override 
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
//        inflater.inflate(R.menu.default_menu_items, menu); 
        super.onCreateOptionsMenu(menu, inflater);
    } 
 
    @Override 
    public boolean onOptionsItemSelected(MenuItem item) {
//        if (item.getItemId() == R.id.menu_map) { 
//            // The room ID for the sandbox, in the map, is just the track ID 
//            final Intent intent = new Intent(getActivity().getApplicationContext(), 
//                    UIUtils.getMapActivityClass(getActivity())); 
//            intent.putExtra(MapFragment.EXTRA_ROOM, 
//                    ParserUtils.translateTrackIdAliasInverse(mTrackId)); 
//            startActivity(intent); 
//            return true; 
//        } 
        return super.onOptionsItemSelected(item);
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
onCreateOptionsMenu Method Overview
Initialize the contents of the Activity's standard options menu.
See Code Examples for other Android Fragment Methods: