i want to place a rating bar in my application which is used to give rating for a specific product. i have used the small ratings bar style. after doing that, when i run the application, i am unable to set the ratings bar upon touching the stars.
My code is:
<RatingBar
android:id="@+id/ratingBar1"
style="?android:attr/ratingBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:progress="30"
/>
the code for oncreate method is:
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.feedback_layout);
OnRatingBarChangeListener rbListener = new OnRatingBarChangeListener() {
@Override
public void onRatingChanged(RatingBar arg0, float arg1, boolean arg2) {
// TODO Auto-generated method stub
//Code here
}
};
final RatingBar rb = (RatingBar)findViewById(R.id.RatingBar01);
rb.setOnRatingBarChangeListener(rbListener);
}