Code example for DatePicker

Methods: setVisibility

0
			@Override 
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {
				dateSelection = (String) adapter.getItem(arg2);
				if (dateSelection.equalsIgnoreCase("between") ) { 
					datePickerEnd.setVisibility(View.VISIBLE);
				} else 
					datePickerEnd.setVisibility(View.INVISIBLE);
					 
				System.out.println("Selection string - " + dateSelection + " arg3 = " + arg3);
			} } 
		); 
		datePicker = (DatePicker)findViewById(R.id.datepicker);
		datePicker.setOnTouchListener(new View.OnTouchListener() {
			@Override 
			public boolean onTouch(View v, MotionEvent event) {
				iDay =datePicker.getDayOfMonth();
				iMonth = datePicker.getMonth();
				iYear = datePicker.getYear();
				calendar.set(iYear, iMonth, iDay);
Stop searching for code, let great code find you!  Add Codota to your java IDE