Example usage for android.view ContextMenu setHeaderTitle

List of usage examples for android.view ContextMenu setHeaderTitle

Introduction

In this page you can find the example usage for android.view ContextMenu setHeaderTitle.

Prototype

public ContextMenu setHeaderTitle(CharSequence title);

Source Link

Document

Sets the context menu header's title to the title given in title.

Usage

From source file:com.paranoid.gerrit.PatchSetViewerFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    committerObject = (CommitterObject) v.getTag();
    menu.setHeaderTitle(R.string.developers_role);
    menu.add(0, v.getId(), OWNER, v.getContext().getString(R.string.context_menu_owner));
    menu.add(0, v.getId(), REVIEWER, v.getContext().getString(R.string.context_menu_reviewer));
}

From source file:org.kochka.android.weightlogger.WeightLoggerActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    if (v.getId() == R.id.mListView) {
        AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
        menu.setHeaderTitle(((Measurement) mList.getItemAtPosition(info.position)).getFormatedRecordedAt());
        menu.add(Menu.NONE, 0, 0, R.string.edit);
        menu.add(Menu.NONE, 1, 1, R.string.delete);
    }/* w  ww .  j  a v  a  2 s . c om*/
}

From source file:de.hshannover.f4.trust.ironcontrol.view.list_activities.ListSavedConnectionsActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle("Context Menu");
    menu.add(0, DEFAULT_ID, 0, R.string.setDefault);
    menu.add(0, EDIT_ID, 0, R.string.edit);
    menu.add(0, REMOVE_ID, 0, R.string.remove);
}

From source file:can.yrt.onebusaway.MySearchRoutesFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
    final TextView text = (TextView) info.targetView.findViewById(R.id.short_name);
    menu.setHeaderTitle(getString(R.string.route_name, text.getText()));
    if (isShortcutMode()) {
        menu.add(0, CONTEXT_MENU_DEFAULT, 0, R.string.my_context_create_shortcut);
    } else {/*from www . ja va 2s.  c o  m*/
        menu.add(0, CONTEXT_MENU_DEFAULT, 0, R.string.my_context_get_route_info);
    }
    menu.add(0, CONTEXT_MENU_SHOW_ON_MAP, 0, R.string.my_context_showonmap);
    final String url = getUrl(getListView(), info.position);
    if (url != null) {
        menu.add(0, CONTEXT_MENU_SHOW_URL, 0, R.string.my_context_show_schedule);
    }
}

From source file:org.kaaproject.kaa.demo.smarthousedemo.smarthouse.DevicesFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    if (v.getId() == R.id.devicesList) {
        AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
        SmartDeviceInfo device = mDevicesAdapter.getItem(info.position);
        menu.setHeaderTitle(device.getDeviceName());
        String[] menuItems = getResources().getStringArray(R.array.deviceContextMenu);
        for (int i = 0; i < menuItems.length; i++) {
            menu.add(getDeviceType().ordinal(), i, i, menuItems[i]);
        }//from ww  w.  j  a v a  2 s .c o m
    }
}

From source file:com.akop.bach.fragment.xboxlive.SentMessagesFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

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

    menu.setHeaderTitle(getString(R.string.sent_message));
    menu.setGroupVisible(R.id.menu_group_gold_required, mAccount.isGold());
}

From source file:nz.co.wholemeal.christchurchmetro.FavouritesActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle(R.string.options);
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.favourite_context_menu, menu);
}

From source file:com.telestax.restcomm_olympus.MainFragment.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    if (v.getId() == android.R.id.list) {
        AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;

        menu.setHeaderTitle("Edit '" + contactList.get(info.position).get("username") + "'");
        menu.add("Update Contact");
        menu.add("Remove Contact");
    }//from www.j  av  a2  s . c  om
}

From source file:org.liberty.android.fantastischmemo.ui.ListEditScreen.java

public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.list_edit_screen_sort_menu, menu);
    menu.setHeaderTitle(R.string.sort_by_text);

}

From source file:org.ambientdynamix.core.HomeActivity.java

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle(R.string.app_list_contextmenu_title);
    menu.add(0, ENABLE_ID, 0, R.string.app_contextmenu_block);
    menu.add(0, DELETE_ID, 0, R.string.app_contextmenu_remove);
}