Code example for RatingBar

Methods: setOnRatingBarChangeListener, setRating

0
		if (fieldType != float.class && fieldType != Float.class) {
			throw new IllegalArgumentException("Views of 'RatingBar' type can only be bound to a fields of 'float' or 'Float' type.");
		} 
		 
		// Set the model value to the view. 
		targetView.setRating((Float)fieldValue);
 
		// Add a listener for changes on the view and update the model accordingly. 
		targetView.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
			 
			@Override 
			public void onRatingChanged(RatingBar ratingBar, float rating,
					boolean fromUser) {
 
				if (!fromUser) {
					return; 
				} 
				 
				try { 
					 
					Method setter = findSetter(methods, field.getName());