Code example for ArrayAdapter

Methods: getPosition

0
 
		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 
 
		return false; 
	} 
 
	public View buildWidget( String elementName, Map<String, String> attributes, AndroidMetawidget metawidget ) {
 
		// Hidden 
 
		if ( TRUE.equals( attributes.get( HIDDEN ) ) ) {
			return new Stub( metawidget.getContext() );
		}