Example usage for android.view Menu toString

List of usage examples for android.view Menu toString

Introduction

In this page you can find the example usage for android.view Menu toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.downrighttech.dmxdip.MainActivity.java

@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
@Override// w w w  .ja  v a  2s.c om
public boolean onCreateOptionsMenu(Menu menu) {
    Log.v(TAG, "onCreateOptionsMenu-" + menu.toString());
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);

    MenuItem shareMenuItem = menu.findItem(R.id.menu_share);
    if (VERSION.SDK_INT >= 14) {

        // get Action Provider from XML
        mShareActionProvider = (ShareActionProvider) shareMenuItem.getActionProvider();

        //Setup shareIntent
        mShareIntent = new Intent(Intent.ACTION_SEND);
        mShareIntent.setType("text/plain");
    } else
        shareMenuItem.setVisible(false);

    return true;
}

From source file:eu.iescities.pilot.rovereto.roveretoexplorer.fragments.event.EventsListingFragment.java

@Override
public void onPrepareOptionsMenu(Menu menu) {

    Log.i("MENU", "start on Prepare Options Menu EVENT LISTING frag: " + menu.toString());

    // menu.clear();

    getActivity().getMenuInflater().inflate(R.menu.list_menu, menu);

    if (category == null) {
        category = (getArguments() != null) ? getArguments().getString(SearchFragment.ARG_CATEGORY) : null;
    }//from ww w .  j  ava 2s.c  o m

    super.onPrepareOptionsMenu(menu);
}

From source file:org.brandroid.openmanager.activities.OpenExplorer.java

public IconContextMenu showIContextMenu(Menu menu, final View from, final boolean fromTouch, int cols) {
    if (menu.findItem(R.id.menu_context_paste) != null) {
        if (!OpenExplorer.USE_PRETTY_CONTEXT_MENUS)
            return null;
    } else if (!OpenExplorer.USE_PRETTY_MENUS)
        return null;

    Logger.LogDebug("Trying to show context menu " + menu.toString()
            + (from != null ? " under " + from.toString() + " (" + from.getLeft() + "," + from.getTop() + ")"
                    : "")
            + ".");
    try {// www .  j  av  a 2s.  c  o  m
        /*
        if(mToolbarButtons != null)
           for(int i = menu.size() - 1; i >= 0; i--)
           {
              MenuItem item = menu.getItem(i);
              if(mToolbarButtons.findViewById(item.getItemId()) != null)
          menu.removeItemAt(i);
           }*/
        onPrepareOptionsMenu(menu);
        IconContextMenu mOpenMenu = new IconContextMenu(this, menu, from);
        if (cols > 1) {
            mOpenMenu.setTextLayout(R.layout.context_item);
            mOpenMenu.setNumColumns(cols);
        }
        mOpenMenu.setOnIconContextItemSelectedListener(this);
        mOpenMenu.show();
        return mOpenMenu;
    } catch (Exception e) {
        Logger.LogWarning("Couldn't show icon context menu.", e);
    }
    return null;
}