Use of RatingBar in Android Studio

program is- 🙂

public class MainActivity extends AppCompatActivity {
    EditText e;
    RatingBar r1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        e=(EditText) findViewById(R.id.editText);
        r1=(RatingBar) findViewById(R.id.ratingBar);
    }
     public void perform (View view)
{
    int n=r1.getProgress();
    e.setText("" + n);
}
}

Leave a Reply