Through layout.xml it is working.
<RatingBar
android:id="@+id/hotel_rating_bar"
style="@style/custom_ratingbar" />
But i want to set the style Dynamically.
Any Answer will be highly appreciated...
Through layout.xml it is working.
<RatingBar
android:id="@+id/hotel_rating_bar"
style="@style/custom_ratingbar" />
But i want to set the style Dynamically.
Any Answer will be highly appreciated...
Dynamically changing the style of views at runtime is not yet supported in Android, except for TextViews
via setTextAppearance.
You have to set the style before the view gets drawn,
either via XML or via Java in the constructor.
RatingBar ratingBar = new RatingBar(context, null, android.R.attr.ratingBarStyleSmall);