android 长按菜单

@Override
	public void onCreateContextMenu(ContextMenu menu, View v,
			ContextMenuInfo menuInfo) {
		if(enableCheckBox.isChecked()) {
			menu.setHeaderTitle(R.string.title);
			menu.add(0, 0, 0, R.string.str_next_played);
		}
		super.onCreateContextMenu(menu, v, menuInfo);
	}
	
	@Override
	public boolean onContextItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case 0:
			playing();
			break;

		default:
			break;
		}
		return super.onContextItemSelected(item);
	}
 

你可能感兴趣的:(android)