Download presentation
Presentation is loading. Please wait.
Published byJudith Carpenter Modified over 8 years ago
1
Contents Searches related to Android RatingBar Basics Android ratingbar example Android custom ratingbar
2
Android Rating Bar Lecture 7
3
Rating Bar Basics To rate some app or websites Widget Rating Bar Property by double clicking :Num stars,Initial rating,step size. Place largetextbox and button //MainActivity.java Declare variables : button,rating bar and textbox Private static Button btm_submit; Private static TextBox txt_box1 Private static RatingBar ratingBar; //Listener for RatingBar Public void listenerForRatingBar() { ratingBar =(RatingBar)findViewById(R.id.RatingBar); Txt_box1=(TextBox)findViewById(R.id.textBox);
4
//Listener ratingBar.setonRatingChangeLsitener( // new listener new RatingBar.OnRatingBarChangeLsitener(){ public void OnRatingChanged(RatingBar ratingBar1, float rating,boolean b) { txt_box1.setText(String.valueOf(ratingr); } ); OnCreate() { listenerForRatingBar(); }
5
//Toast On Message Public void onButtonClickListener() { ratingBar =(RatingBar)findViewById(R.id.RatingBar); btm_submit=(Button) findViewById(R.id.Button); Btm_submit.setOnClickListener( new View.onClickListener() { public void OnClick(View v) { Toast.makeText(MainActivity.this, String.valueOf(ratingBar),Toast.LENGTH_SHORT); } );
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.