AIDE Tutorial - 50 Rating Bar
Watch the Video Below
Main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
Watch the Video Below
Main.xml
<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 Our App"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
android:text="Rate Our App"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<RatingBar
android:text="Rate: "
android:id="@+id/mainRatingBar"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
android:text="Rate: "
android:id="@+id/mainRatingBar"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<TextView
android:textSize="20sp"
android:id="@+id/mainTextView"
android:text="Rating :"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
android:textSize="20sp"
android:id="@+id/mainTextView"
android:text="Rating :"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
MainActivity.java
package com.kcgroup.ratingbar;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.widget.RatingBar.*;
package com.kcgroup.ratingbar;
import android.app.*;
import android.os.*;
import android.widget.*;
import android.widget.RatingBar.*;
public class MainActivity extends Activity
{ @Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView Result=(TextView)findViewById(R.id.mainTextView);
RatingBar RB=(RatingBar)findViewById(R.id.mainRatingBar);
RB.setOnRatingBarChangeListener(new OnRatingBarChangeListener(){
@Override
public void onRatingChanged(RatingBar arg0,float rating,boolean arg2){Result.setText("Rating :"+String.valueOf(rating));}}); }}
{ @Override
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView Result=(TextView)findViewById(R.id.mainTextView);
RatingBar RB=(RatingBar)findViewById(R.id.mainRatingBar);
RB.setOnRatingBarChangeListener(new OnRatingBarChangeListener(){
@Override
public void onRatingChanged(RatingBar arg0,float rating,boolean arg2){Result.setText("Rating :"+String.valueOf(rating));}}); }}
0 comments:
Post a Comment