Code example for Date

Methods: getDate, getMonth, getYear

0
 
		// DatePicker 
 
		if ( view instanceof DatePicker ) {
			Date date = (Date) value;
			( (DatePicker) view ).updateDate( 1900 + date.getYear(), date.getMonth(), date.getDate() );
			return true; 
		} 
 
		// Spinner 
 
		if ( view instanceof Spinner ) {
			AdapterView<?> adapterView = (AdapterView<?>) view;
			@SuppressWarnings( "unchecked" ) 
			ArrayAdapter<Object> adapter = (ArrayAdapter<Object>) adapterView.getAdapter();
			adapterView.setSelection( adapter.getPosition( value ) );
			return true; 
		} 
 
		// Unknown