Code example for ContextMenu

Methods: add

0
	private View.OnCreateContextMenuListener mBtnLengthOnCtxListener  = new View.OnCreateContextMenuListener() {
 
		@Override 
		public void onCreateContextMenu(ContextMenu menu, View v, 
				ContextMenuInfo menuInfo) { 
			menu.add(0, SECONDS, 0, "Second(s)"); 
			menu.add(0, MINUTES, 1, "Minute(s)"); 
			menu.add(0, HOURS, 2, "Hour(s)"); 
		} 
		 
	}; 
	 
	private View.OnClickListener mBtnOkOnClick = new View.OnClickListener() {
 
		@Override 
		public void onClick(View v) { 
			try { 
				int nt = Integer.parseInt(mEtNumber.getText().toString()); 
				switch (mCurrentLength) { 
				case HOURS: 
					nt = nt*60;