android - Rating Bar problem
<p>My application have 3 rating bars(R1,R2,R3). I am setting the rating bars using WS response. Sequence is like this R1,R2,R3. R1 is setting correctly but at R2 i am getting the NPE. i am getting the correct values from WS. How to handle it. can anybody help me.</p>

<p><code>java code</code></p>

<pre><code>     float rating = RB_Constant.filterSearchResultObj.response.get(position).Rating;
            float rating_value = Math.round(rating * 10);           
        float rating_value_w_onedecimal = rating_value / 10;
        System.out.println("Total rating Value:"+rating_value_w_onedecimal);           
            try{
                holder.r1.setRating(rating_value_w_onedecimal);
            }
            catch(Exception e){
                System.out.println("Error-&gt;"+e.toString()+" position "+position);
            }            

            float ksrating = RB_Constant.filterSearchResultObj.response.get(position).KidsRating;
            float ksrating_value = Math.round(ksrating * 10);           
        float ksrating_value_w_onedecimal = ksrating_value / 10;
        System.out.println("ksrating Value:"+ksrating_value_w_onedecimal);
            try{
                System.out.println("Before KS in try");
                ***holder.r2.setRating(ksrating_value_w_onedecimal);***
                System.out.println("After KS in try");
            }
            catch(Exception e){
                System.out.println("Error-&gt;"+e.toString()+" position "+position);
            }            


            float rrrating = RB_Constant.filterSearchResultObj.response.get(position).RestRoomRating;
            float rrrating_value = Math.round(rrrating * 10);           
        float rrrating_value_w_onedecimal = rrrating_value / 10;
        System.out.println("rrrating Value:"+rrrating_value_w_onedecimal);
        try{
                holder.r3.setRating(rrrating_value_w_onedecimal);
            }
            catch(Exception e){
                System.out.println("Error-&gt;"+e.toString()+" position "+position);
            }            

`xml code:`
                                &lt;RatingBar android:id="@+id/small_ratingbar"
                             android:layout_width="wrap_content"
                             android:layout_marginLeft="2dip" 
                             android:layout_height="12dip"
                             android:stepSize="0.1"
                             android:numStars="5"
                             style="@style/reviewRatingBar1" 
                             android:layout_gravity="center_vertical" 
                             android:clickable="false" 
                             android:focusableInTouchMode="false" 
                             android:focusable="false"/&gt;   

                               &lt;RatingBar android:id="@+id/kssmall_ratingbar"
                            android:layout_width="wrap_content"
                            android:layout_marginLeft="2dip" 
                            android:layout_height="12dip"
                            android:stepSize="0.1"
                            android:numStars="5" 
                            style="@style/reviewRatingBar1" 
                            android:layout_gravity="center_vertical" 
                            android:clickable="false" 
                            android:focusableInTouchMode="false"/&gt;  


                               &lt;RatingBar android:id="@+id/rrsmall_ratingbar"
                            android:layout_width="wrap_content"
                            android:layout_height="12dip"
                            android:layout_marginLeft="2dip" 
                            android:stepSize="0.1"
                            android:numStars="5" 
                            style="@style/reviewRatingBar1" 
                            android:layout_gravity="center_vertical" 
                            android:clickable="false" 
                            android:focusableInTouchMode="false"/&gt;  
</code></pre>
