Java Code Examples for android.widget.RatingBar.setOnRatingBarChangeListener()

The following are Jave code examples for showing how to use setOnRatingBarChangeListener() of the android.widget.RatingBar class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: 2017.1-Trezentos   File:   View Source Code Vote up 5 votes
public EvaluationViewHolder(View view) {
    className = (TextView) view.findViewById(;
    examName = (TextView) view.findViewById(;
    userAccountName = (TextView) view.findViewById(;
    ratingBar = (RatingBar) view.findViewById(;
Example 2
Project: iosched-reader   File:   View Source Code Vote up 4 votes
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.session_feedback_frag, container, false);

    mTitle = (TextView) rootView.findViewById(;
    mSpeakers = (TextView) rootView.findViewById(;
    mOverallFeedbackBar = (RatingBar) rootView.findViewById(;
    mSessionRelevantFeedbackBar = (NumberRatingBar) rootView.findViewById(
    mContentFeedbackBar = (NumberRatingBar) rootView.findViewById(;
    mSpeakerFeedbackBar = (NumberRatingBar) rootView.findViewById(;

    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        // Helps accessibility services determine the importance of this view.

        // Automatically notifies the user about changes to the view's content description.

    // When the rating changes, update the content description. In TalkBack mode, this
    // informs the user about the selected rating.
    mOverallFeedbackBar.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
        public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
                    getString(R.string.updated_session_feedback_rating_bar_content_description, (int) rating));

            new View.OnClickListener() {
                public void onClick(View view) {
    return rootView;