Google Mapアプリケーションを使用して、ユーザーがマーカーを使用して選択したレストランで評価して、その評価値をsq liteデータベースに保存し、ボタンを押すと、名前と評価値がスクロールビューの文字列として表示されます。 評価値を星として、つまりユーザーの入力方法として表示したいと考えています。 星の数としてデータベースに保存されている評価値を表示する方法
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<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" />
<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" />
<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" />
<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" />
<Button
android:text="Submit"
android:layout_width="395dp"
android:layout_height="wrap_content"
android:id="@+id/submit"
android:onClick="insert"/>
<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"/>
<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" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<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" />
<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" />
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
あなたはそのための 'RatingBar'を使用することができます役立ちます。 –