title: how to display rating value that is stored in database as number of stars
body: <p>i have a google map app where users can rate on the restaurant they select via marker i stored that rating value in sq lite database and when they click on view rating button i display the name and rating value as string in the scrollview.
  Now i want to show that rating value as stars i.e the way the user enters. 
  <a href="https://i.stack.imgur.com/03Kkd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/03Kkd.png" alt="this is how i want to display when view rating is clicked"></a></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"&gt;
  
  &lt;TextView
      android:text="Rate me"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textSize="20dp"
      android:id="@+id/rateme"
      android:layout_weight="0.00" /&gt;
  
  &lt;TextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:inputType="textPersonName"
      android:text="Restaurent Name"
      android:ems="10"
      android:id="@+id/place"
      android:layout_weight="0.00" /&gt;
  &lt;RatingBar
      android:id="@+id/ratingBar"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:numStars="5"
      android:stepSize="1.0"
      android:rating="2.0"
      android:layout_marginTop="64dp"
      android:layout_below="@+id/place"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true" /&gt;
  &lt;TextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:inputType="textPersonName"
  
      android:ems="10"
      android:id="@+id/rate"
      android:layout_weight="0.00" /&gt;
  
  &lt;Button
      android:text="Submit"
      android:layout_width="395dp"
      android:layout_height="wrap_content"
      android:id="@+id/submit"
      android:onClick="insert"/&gt;
  
  &lt;Button
      android:text="view Rating"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:id="@+id/viewrate"
      android:layout_weight="0.00"
      android:onClick="display"/&gt;
  &lt;ScrollView
      android:id="@+id/scrollView1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentRight="true"
      android:layout_below="@+id/button2" &gt;
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical" &gt;
  
  
  
  
          &lt;TextView
              android:id="@+id/tv"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:gravity="center"
              android:textStyle="bold" /&gt;
          &lt;RatingBar
              android:id="@+id/rat"
              style="?android:attr/ratingBarStyleSmall"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:numStars="5"
              android:isIndicator="false"
              android:layout_weight="0.07" /&gt;
          /&gt;
  
  
  
  
      &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  
   &lt;/LinearLayout&gt;
  </code></pre>