Wednesday 15 July 2015

android - why custom style for rating bar error inflating? -


Am I having a problem with custom style for rating?

  03-26 15: 22: 12.229: E / AndroidRuntime (2075): Fatal Exception: Main 03-26 15: 22: 12.229: E / AndroidRuntime (2075): android.view. InflateException: Binary XML File Line # 54: Errors in Classroom Enlarging Android widget.RatingBar 03-26 15: 22: 12.229: E / AndroidRuntime (2075): android.view.LayoutInflater.createView (LayoutInflater.java:518) 03-26 15: 22 to: 12.229: E / AndroidRuntime (2075): 22: 12.229: com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView (PhoneLayoutInflater.java:56) at 03-26 15 e / AndroidRuntime (2075): android.view.LayoutInflater.createViewFromTag (on LayoutInflater.java: 568 ) ...... 03-26 15: 22: 12.229: e / AndroidRuntime (2075): java.lang.NumberFormatException: because of race / drawable / ratingbar_yellow.xml 'Unable to parse as an integer < / Code>  

My ratingbar_image Xml

  & lt; Android Android: id = "@ + Android: ID / Background" Android: drawable = "@Picture a ble / rate_star_small_off" /> & Lt; Android Android: ID = "@ + Android: ID / Secondary Progress" Android: Drawable = "@ Drable / Rate_star_sml_off" /> & Lt; Android Android: ID = "@ + Android: ID / Progress" Android: Dragon = "@ Drauble / Rate_star_sml_on" />   

My style

  & lt; Style name = "yellowRatingBarSmall" generator = "@Android: Style / Widget.RatingBar" & gt; & Lt; Item name = "Android: Progress Drawable" & gt; @drawable / ratingbar_lila & lt; / Item & gt; & Lt; Item Name = "Android: Secondary Progress" & gt; @drawable / ratingbar_legames & lt; / Item & gt; & Lt; Item name = "Android: Minhite" & gt; 14dip & lt; / Item & gt; & Lt; Item name = "android: maxHeight" & gt; 14dip & lt; / Item & gt; & Lt; Item name = "android: isindicator" & gt; True & lt; / Item & gt; & Lt; Item name = "Android: only uncertain" & gt; Wrong & lt; / Item & gt; & Lt; / Style & gt;   

In my layout

  & lt; RatingBar android: id = "@ + id / restaurant_rating" style = "@ style / yellowRatingBarSmall" Android: layout_width = "Wrap_content" Android: layout_height = "wrap_content" / & gt;    

caused by: java.lang.NumberFormatException: Unable to parse ' Res /drawable/ratingbar_yellow.xml As an integer

I think the problem is your announcement id you are doing it wrong.

  android: id = "@ + Android: id / background"   

should be:

  android: Id = "@ + ID / Background"    

No comments:

Post a Comment