Java Code Examples for android.view.ContextMenu

The following examples show how to use android.view.ContextMenu. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Favorite-Android-Client   Source File: ProfileEdit.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
		ContextMenuInfo menuInfo) {
	//Log.i("ContextMenu", "Contextmenu");
	if (v.getId() == R.id.profile_image) {

		menu.setHeaderIcon(android.R.drawable.btn_star);
		// menu.setHeaderTitle("공지사항");
		menu.add(Menu.NONE, 1, Menu.NONE,
				getString(R.string.choose_picture));
		menu.add(Menu.NONE, 2, Menu.NONE, getString(R.string.camera));
		menu.add(Menu.NONE, 3, Menu.NONE, getString(R.string.delete));

	}

	super.onCreateContextMenu(menu, v, menuInfo);

}
 
Example 2
public void createContextMenu(ContextMenu menu, ContextMenu.ContextMenuInfo menuInfo) {
	MyLog.entry("menuInfo = " + menuInfo);

	final ChooseModelContainer<SyncedMonsterModel> monsterItem = getMonsterItem(menuInfo);
	menu.setHeaderTitle(getContext().getString(R.string.choose_sync_context_menu_one_title, monsterItem.getModel().getDisplayedMonsterInfo().getName()));
	if (monsterItem.isChosen()) {
		menu.add(getGroupId(), MENU_ID_DESELECT, 0, R.string.choose_sync_context_menu_one_deselect);
	} else {
		menu.add(getGroupId(), MENU_ID_SELECT, 0, R.string.choose_sync_context_menu_one_select);
	}

	if (getMode() != SyncMode.DELETED) {
		menu.add(getGroupId(), MENU_ID_CHANGE_PRIORITY, 0, R.string.choose_sync_context_menu_one_change_priority);
		menu.add(getGroupId(), MENU_ID_CHANGE_NOTE, 0, R.string.choose_sync_context_menu_one_change_note);
	}

	if (new DefaultSharedPreferencesHelper(getContext()).isChooseSyncUseIgnoreListForMonsters(getMode())) {
		menu.add(getGroupId(), MENU_ID_ADD_TO_IGNORE_LIST, 0, R.string.choose_sync_context_menu_one_add_to_ignore_list);
	}

	MyLog.exit();
}
 
Example 3
Source Project: delion   Source File: RecentTabsPage.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    // Would prefer to have this context menu view managed internal to RecentTabsGroupView
    // Unfortunately, setting either onCreateContextMenuListener or onLongClickListener
    // disables the native onClick (expand/collapse) behaviour of the group view.
    ExpandableListView.ExpandableListContextMenuInfo info =
            (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;

    int type = ExpandableListView.getPackedPositionType(info.packedPosition);
    int groupPosition = ExpandableListView.getPackedPositionGroup(info.packedPosition);

    if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
        mAdapter.getGroup(groupPosition).onCreateContextMenuForGroup(menu, mActivity);
    } else if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
        int childPosition = ExpandableListView.getPackedPositionChild(info.packedPosition);
        mAdapter.getGroup(groupPosition).onCreateContextMenuForChild(childPosition, menu,
                mActivity);
    }
}
 
Example 4
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
  TextView contextMenuTextView = (TextView) v;
  Context context = getContext();
  menu.add(android.R.string.copy)
      .setOnMenuItemClickListener(
          item -> {
            ClipboardManager clipboard =
                (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);
            clipboard.setPrimaryClip(
                ClipData.newPlainText(CLIP_DATA_LABEL, contextMenuTextView.getText()));
            return true;
          });

  menu.add(R.string.context_menu_highlight)
      .setOnMenuItemClickListener(
          item -> {
            highlightText(contextMenuTextView);
            return true;
          });
}
 
Example 5
Source Project: uPods-android   Source File: ActivityMain.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater inflater = getMenuInflater();
    if (contextMenuType == ContextMenuType.PODCAST_MIDDLE_SCREEN) {
        inflater.inflate(R.menu.menu_basic_sceleton, menu);
        menu.add(getString(R.string.about_podcast));
        if (((Podcast) currentContextMenuData).isDownloaded) {
            menu.add(getString(R.string.open_on_disk));
            menu.add(getString(R.string.remove_all_episods));
        }
    } else if (contextMenuType == ContextMenuType.EPISODE_MIDDLE_SCREEN) {
        inflater.inflate(R.menu.menu_basic_sceleton, menu);
        menu.add(getString(R.string.marks_as_played));
        Track track = ((MediaItem.MediaItemBucket) currentContextMenuData).track;
        if (((Episode) track).isDownloaded) {
            menu.add(getString(R.string.delete));
        }
    } else if (contextMenuType == ContextMenuType.PROFILE) {
        inflater.inflate(R.menu.menu_logedin_profile, menu);
    } else {
        inflater.inflate(R.menu.menu_activity_main, menu);
    }
}
 
Example 6
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
  super.onCreateContextMenu(menu, v, menuInfo);
  AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
  PinInfo selectedUser = users[(int) info.id];
  getMenuInflater().inflate(R.menu.account_list_context, menu);
  menu.setHeaderTitle(selectedUser.getIndex().getStrippedName());

  if (!isRenameAccountAvailableSupported(selectedUser)) {
    menu.removeItem(R.id.rename);
  }

  if (!isCheckAccountKeyValueSupported(selectedUser)) {
    menu.removeItem(R.id.check_code);
  }

  mostRecentContextMenu = menu;
}
 
Example 7
Source Project: YiBo   Source File: MicroBlogContextMenuListener.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
		ContextMenuInfo menuInfo) {
	final AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
	Adapter adapter = lvMicroBlog.getAdapter();
	this.position = info.position;
	targetView = info.targetView;
	Status status= (Status)adapter.getItem(position);
	if (status == null 
		|| (status instanceof LocalStatus
			&& ((LocalStatus)status).isDivider())) {
		return;
	}

	Context context = v.getContext();
	analyzeStatusMenu(adapter, status, menu, context);
}
 
Example 8
Source Project: fingen   Source File: FragmentSummary.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater menuInflater = Objects.requireNonNull(getActivity()).getMenuInflater();
    menuInflater.inflate(R.menu.context_menu_summary, menu);
    final MenuItem item = menu.findItem(R.id.action_show_report);
    ((ToolbarActivity) getActivity()).unsubscribeOnDestroy(
            mBillingService.getReportsIapInfo()
                    .subscribeOn(Schedulers.io())
                    .observeOn(AndroidSchedulers.mainThread())
                    .subscribe(
                            skuDetailsWrapper -> {
                                if (skuDetailsWrapper.isPurchased()) {
                                    item.setVisible(true);
                                } else {
                                    item.setVisible(false);
                                }
                            },
                            throwable -> item.setVisible(false)));
}
 
Example 9
Source Project: ActivityLauncher   Source File: AllTasksListFragment.java    License: ISC License 6 votes vote down vote up
@Override
public void onCreateContextMenu(@NonNull ContextMenu menu, @NonNull View v,
                                ContextMenuInfo menuInfo) {
    menu.add(Menu.NONE, 0, Menu.NONE, R.string.context_action_shortcut);
    menu.add(Menu.NONE, 1, Menu.NONE, R.string.context_action_launch);

    ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) menuInfo;
    ExpandableListView list = getView().findViewById(R.id.expandableListView1);

    switch (ExpandableListView.getPackedPositionType(info.packedPosition)) {
        case ExpandableListView.PACKED_POSITION_TYPE_CHILD:
            MyActivityInfo activity = (MyActivityInfo) list.getExpandableListAdapter().getChild(ExpandableListView.getPackedPositionGroup(info.packedPosition), ExpandableListView.getPackedPositionChild(info.packedPosition));
            menu.setHeaderIcon(activity.icon);
            menu.setHeaderTitle(activity.name);
            menu.add(Menu.NONE, 2, Menu.NONE, R.string.context_action_edit);
            break;
        case ExpandableListView.PACKED_POSITION_TYPE_GROUP:
            MyPackageInfo pack = (MyPackageInfo) list.getExpandableListAdapter().getGroup(ExpandableListView.getPackedPositionGroup(info.packedPosition));
            menu.setHeaderIcon(pack.icon);
            menu.setHeaderTitle(pack.name);
            break;
    }

    super.onCreateContextMenu(menu, v, menuInfo);
}
 
Example 10
Source Project: AndroidChromium   Source File: RecentTabsRowAdapter.java    License: Apache License 2.0 6 votes vote down vote up
@Override
void onCreateContextMenuForChild(final int childPosition, ContextMenu menu,
        Activity activity) {
    if (isMoreButton(childPosition)) return;
    OnMenuItemClickListener listener = new OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            mRecentTabsManager.closeTab(getChild(childPosition));
            return true;
        }
    };
    menu.add(R.string.close_tab).setOnMenuItemClickListener(listener);
}
 
Example 11
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    if (!canCreateContextMenu(menu, menuInfo)) {
        return;
    }
    menu.clear();
    ViewHolder holder = (ViewHolder) ((AdapterContextMenuInfo) menuInfo).targetView.getTag();
    menu.setHeaderTitle(holder.nameView.getText());
    if (holder.icon != null) {
        setHeaderIcon(menu, holder.icon);
    }
    menu.add(Menu.NONE, R.string.app_info, Menu.NONE, R.string.app_info);
    updatePreventMenu(menu, holder.packageName);
    if (getMainIntent(holder.packageName) != null) {
        menu.add(Menu.NONE, R.string.open, Menu.NONE, R.string.open);
    }
    if (holder.canUninstall) {
        menu.add(Menu.NONE, R.string.uninstall, Menu.NONE, R.string.uninstall);
    }
    if (appNotification) {
        menu.add(Menu.NONE, R.string.app_notifications, Menu.NONE, R.string.app_notifications);
    }
}
 
Example 12
Source Project: odyssey   Source File: FilesFragment.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * Create the context menu.
 */
@Override
public void onCreateContextMenu(@NonNull ContextMenu menu, @NonNull View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    MenuInflater inflater = getActivity().getMenuInflater();

    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
    FileModel currentFile = mAdapter.getItem(info.position);

    if (currentFile.isFile()) {
        // show context menu for files
        inflater.inflate(R.menu.context_menu_files_files_fragment, menu);

        // hide enqueue as next for playlist files
        menu.findItem(R.id.fragment_files_action_enqueueasnext).setVisible(!currentFile.isPlaylist());
    } else {
        // show context menu for directories
        inflater.inflate(R.menu.context_menu_directories_files_fragment, menu);
    }
}
 
Example 13
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    final SipProfile account = profileFromContextMenuInfo(menuInfo);
    if(account == null) {
        return;
    }
    WizardInfo wizardInfos = WizardUtils.getWizardClass(account.wizard);

    // Setup the menu header
    menu.setHeaderTitle(account.display_name);
    if(wizardInfos != null) {
        menu.setHeaderIcon(wizardInfos.icon);
    }
    
    menu.add(0, MENU_ITEM_ACTIVATE, 0, account.active ? R.string.deactivate_account
            : R.string.activate_account);
    menu.add(0, MENU_ITEM_MODIFY, 0, R.string.modify_account);
    menu.add(0, MENU_ITEM_DELETE, 0, R.string.delete_account);
    menu.add(0, MENU_ITEM_WIZARD, 0, R.string.choose_wizard);

}
 
Example 14
Source Project: NanoIconPack   Source File: AppAdapter.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
    contextMenu.setHeaderTitle(dataList.get(contextMenuActiveItemPos).getLabel());
    contextMenu.add(Menu.NONE, 0, Menu.NONE, R.string.menu_request_icon);
    contextMenu.add(Menu.NONE, 1, Menu.NONE, R.string.menu_copy_code);
    contextMenu.add(Menu.NONE, 2, Menu.NONE, R.string.menu_save_icon);
    contextMenu.getItem(0).setOnMenuItemClickListener(this);
    contextMenu.getItem(1).setOnMenuItemClickListener(this);
    contextMenu.getItem(2).setOnMenuItemClickListener(this);

    contextMenu.getItem(0).setVisible(enableStatsModule);
}
 
Example 15
Source Project: HayaiLauncher   Source File: SearchActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
                                ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    if (menuInfo instanceof AdapterContextMenuInfo) {
        AdapterContextMenuInfo adapterMenuInfo = (AdapterContextMenuInfo) menuInfo;
        menu.setHeaderTitle(
                ((LaunchableActivity) adapterMenuInfo.targetView
                        .findViewById(R.id.appIcon).getTag()).getActivityLabel());
    }
    final MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.app, menu);
}
 
Example 16
@Override
public void onCreateContextMenu(@NonNull ContextMenu menu, @NonNull View v, ContextMenu.ContextMenuInfo menuInfo) {
    Module module = getItemFromContextMenuInfo(menuInfo);
    if (module == null)
        return;

    menu.setHeaderTitle(module.name);
    requireActivity().getMenuInflater().inflate(R.menu.context_menu_modules_bookmark, menu);
}
 
Example 17
Source Project: 4pdaClient-plus   Source File: NotesListFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
    if (info.id == -1) return;

    if (info.id  < 0 || getAdapter().getCount() <= info.id ) return;

    Object o = getAdapter().getItem((int) info.id );
    if (o == null)
        return;
    final IListItem topic = (IListItem) o;

    final List<MenuListDialog> list = new ArrayList<>();
    AddLinksSubMenu(list, topic);
    list.add(new MenuListDialog(App.getContext().getString(R.string.delete), () -> new MaterialDialog.Builder(getContext())
            .title(R.string.confirm_action)
            .content(R.string.ask_delete_note)
            .cancelable(true)
            .negativeText(R.string.cancel)
            .positiveText(R.string.delete)
            .onPositive((dialog, which) -> {
                try {
                    NotesTable.delete(topic.getId().toString());
                    getMData().remove(topic);
                    getAdapter().notifyDataSetChanged();
                } catch (Throwable ex) {
                    AppLog.e(getContext(), ex);
                }
            })
            .show()));
    ExtUrl.showContextDialog(getContext(), null, list);

}
 
Example 18
Source Project: pandora   Source File: SPFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    if (menuInfo instanceof MenuRecyclerView.RvContextMenuInfo) {
        MenuRecyclerView.RvContextMenuInfo info = (MenuRecyclerView.RvContextMenuInfo) menuInfo;
        if (getAdapter().getItems().get(info.position) instanceof KeyValueItem) {
            if (!((KeyValueItem) getAdapter().getItems().get(info.position)).isTitle) {
                menu.add(-1, 0, 0, R.string.pd_name_copy_value);
                menu.add(-1, 0, 1, R.string.pd_name_delete_key);
            }
        }
    }
}
 
Example 19
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    final Activity activity = XmppActivity.find(v);
    final Object tag = v.getTag();
    if (activity != null && tag instanceof Room) {
        activity.getMenuInflater().inflate(R.menu.channel_item_context, menu);
        this.current = (Room) tag;
    }
}
 
Example 20
Source Project: coolreader   Source File: BookmarkActivity.java    License: MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    lvBookMark = getListView();
    resolver = getContentResolver();
    bookMarks = DbDataOperation.getBookMark(resolver);
    lvBookMark.setBackgroundResource(R.drawable.bg_listview);
    lvBookMark.setAdapter(adapter);
    lvBookMark.setDivider(null);
    lvBookMark.setCacheColorHint(000000);
    lvBookMark.setOnItemClickListener(new OnItemClickListener()
    {
        public void onItemClick(AdapterView<?> parent, View view,
                int position, long id)
        {
            currentPosition = position;
            intentToRead();
        }
    });
    lvBookMark.setOnCreateContextMenuListener(new OnCreateContextMenuListener()
    {
        public void onCreateContextMenu(ContextMenu menu, View v,
                ContextMenuInfo menuInfo)
        {
            AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
            currentPosition = info.position;
            menu.add(Menu.NONE,R.id.menu_open,0,"打开");
            menu.add(Menu.NONE, R.id.menu_del, 1, "删除 " ); 
            menu.add(Menu.NONE, R.id.menu_des, 1, "详细 " ); 
  
        }
    });
}
 
Example 21
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    
    // For context menu, the standard menu inflater must be used
    // https://groups.google.com/forum/?fromgroups=#!topic/actionbarsherlock/wQlIvR-jUYQ
    
    android.view.MenuInflater inflater = getActivity().getMenuInflater();
    inflater.inflate(R.menu.sourcenames_context, menu);
    
    AdapterView.AdapterContextMenuInfo aMenuInfo = (AdapterView.AdapterContextMenuInfo) menuInfo;
    mLastSelected = mPartFile.getSourceNames().get(aMenuInfo.position).getName();

}
 
Example 22
Source Project: document-viewer   Source File: OPDSActivity.java    License: GNU General Public License v3.0 5 votes vote down vote up
protected void onCreateBookContextMenu(final ContextMenu menu, final Book book) {
    final MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.opds_bookmenu, menu);

    menu.setHeaderTitle(book.title);
    ActionMenuHelper.setMenuParameters(getController(), menu, new Constant("book", book));
}
 
Example 23
Source Project: AndroidChromium   Source File: ContextualSearchTabHelper.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onContextMenuShown(Tab tab, ContextMenu menu) {
    ContextualSearchManager manager = getContextualSearchManager();
    if (manager != null) {
        manager.onContextMenuShown();
    }
}
 
Example 24
Source Project: TapUnlock   Source File: MainActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);

    menu.add(getResources().getString(R.string.rename_context_menu));
    menu.add(getResources().getString(R.string.delete_context_menu));
}
 
Example 25
Source Project: beaconloc   Source File: DetectedBeaconsFragment.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo
        menuInfo) {

    super.onCreateContextMenu(menu, view, menuInfo);

    MenuInflater inflater = getActivity().getMenuInflater();
    inflater.inflate(R.menu.menu_detected_list, menu);
}
 
Example 26
Source Project: styT   Source File: Main.java    License: Apache License 2.0 5 votes vote down vote up
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo) menuInfo;
    menu.setHeaderTitle("操作");
    if (this.alItemApk.get(acmi.position).getRunning()) {
        // menu.add(0, CM_FORCE_CLOSE, 0, R.string.force_close);
    } else {
        menu.add(0, CM_LAUNCH, 0, "启动");
    }
    menu.add(0, CM_DETAILS, 0, "市场查看");
    super.onCreateContextMenu(menu, v, menuInfo);
}
 
Example 27
public void createContextMenu(ContextMenu menu, ContextMenu.ContextMenuInfo menuInfo) {
	MyLog.entry("menuInfo = " + menuInfo);
	if (isGroup(menuInfo)) {
		createContextMenuForGroup(menu, menuInfo);
	} else {
		createContextMenuForChild(menu, menuInfo);
	}
	MyLog.exit();
}
 
Example 28
private void setHeaderIcon(ContextMenu menu, Drawable icon) {
    int width = getHeaderIconWidth();
    if (icon.getMinimumWidth() <= width) {
        menu.setHeaderIcon(icon);
    } else if (icon instanceof BitmapDrawable) {
        Bitmap bitmap = Bitmap.createScaledBitmap(((BitmapDrawable) icon).getBitmap(), width, width, false);
        menu.setHeaderIcon(new BitmapDrawable(getResources(), bitmap));
    }
}
 
Example 29
Source Project: mobile-manager-tool   Source File: PlaylistsFragment.java    License: MIT License 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    AdapterContextMenuInfo mi = (AdapterContextMenuInfo)menuInfo;
    menu.add(mFragmentGroupId, PLAY_SELECTION, 0, getResources().getString(R.string.play_all));
    if (mi.id >= 0) {
        menu.add(mFragmentGroupId, RENAME_PLAYLIST, 0, getResources().getString(R.string.rename_playlist));
        menu.add(mFragmentGroupId, DELETE_PLAYLIST, 0, getResources().getString(R.string.delete_playlist));
    }
    mCurrentId = mCursor.getString(mCursor.getColumnIndexOrThrow(BaseColumns._ID));
    String title = mCursor.getString(mCursor.getColumnIndexOrThrow(PlaylistsColumns.NAME));
    menu.setHeaderTitle(title);
}
 
Example 30
Source Project: mobile-manager-tool   Source File: GenresFragment.java    License: MIT License 5 votes vote down vote up
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    menu.add(mFragmentGroupId, ADD_TO_LOVE, 0, getResources().getString(R.string.play_all));
    mCurrentId = mCursor.getString(mCursor.getColumnIndexOrThrow(BaseColumns._ID));
    String title = mCursor.getString(mCursor.getColumnIndexOrThrow(Audio.Genres.NAME));
    menu.setHeaderTitle(title);
}