RatingBar onClick

后端 未结 5 880
孤街浪徒
孤街浪徒 2020-12-25 13:59

I have a ListView that uses different XML files to create Views and make items out of. One of these XML files contains a RatingBar. Everything displays and looks excellent

5条回答
  •  借酒劲吻你
    2020-12-25 14:47

    Andrew, you can just try to use another event available for RatingBar, OnRatingBarChangeListener. See this example, it works for me!

    ratingBar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
    
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
                viewMarketDetails(mContext);
                dialog.dismiss();
            }
        });
    

    So you don't need to use the onClickEvent but you have the same effect, but only work, off course, if you change actually the value. (If you click on the actual value, if has no effect)

提交回复
热议问题