Skip to content
This repository has been archived by the owner on Jun 22, 2023. It is now read-only.

Updated the SimpleFragment.java #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,17 @@ public void onCheckedChanged(RadioGroup group,
@Override
public void onRatingChanged(RatingBar ratingBar,
float rating, boolean fromUser) {
// Get rating and show Toast with rating.
String myRating = (getString(R.string.my_rating) +
String.valueOf(ratingBar.getRating()));
Toast.makeText(getContext(), myRating,
Toast.LENGTH_SHORT).show();
// Get rating and show Toast with rating(Old).
// String myRating = (getString(R.string.my_rating) +
// String.valueOf(ratingBar.getRating()));
// Toast.makeText(getContext(), myRating,
// Toast.LENGTH_SHORT).show();

// Get rating and show Toast with rating(New).
// instead of above code you can write only the following as the 'rating' parameter is there to complete your needs
Toast.makeText(getContext(), rating,
// Toast.LENGTH_SHORT).show();

}
});

Expand Down