title: Android: RatingBar - How to add rating to DB?
body: <p>Noob here again.</p>
  
  <p>I've followed the example given by Google Dev (and read a couple of other tutorials) on how to add a RatingBar to your form/app. However I have been unable to find any examples on the net, of how to take the Rating given and add it as a value to your SQLite database.</p>
  
  <p>Currently you can add your own rating by simply putting a number in an EditText field. However this is not ideal, and the RatingBar seems like a more ideal solution. I suspect it has something to do with OnClick() but Im not entirely sure being a beginner.</p>
  
  <p>Any ideas?</p>
  
  <p>RatingBar:</p>
  
  <pre><code>final RatingBar ratingbar = (RatingBar) findViewById(R.id.ratingbar);
          ratingbar.setOnRatingBarChangeListener(new OnRatingBarChangeListener() { 
          public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser) {
                  Toast.makeText(AddBook.this, "New Rating: " + rating, Toast.LENGTH_SHORT).show();
  
          }
      });
  </code></pre>
  
  <p>AddRow:</p>
  
  <pre><code>db.addRow
          (
  
                  textFieldOne.getText().toString(),
                  textFieldTwo.getText().toString(),
                  textFieldThree.getText().toString(),
                  textFieldFour.getText().toString(),
                  textFieldFive.getText().toString(),
                  textFieldSix.getText().toString()
  
  
  
  
  
          );
  
          // request the table be updated
          updateTable();
  </code></pre>