Created
August 26, 2014 08:18
-
-
Save anonymous/430772a20fde399680ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ratingBar.setOnClickListener(new OnClickListener() { | |
@Override | |
public void onClick(View arg0) { | |
Log.i("ETNUMBER", | |
"" + Integer.parseInt(etNumber.getText().toString())); | |
if (Integer.parseInt(etNumber.getText().toString()) == 1) { | |
Toast.makeText(getApplicationContext(), "You can rate it", | |
Toast.LENGTH_LONG).show(); | |
ratingBar | |
.setOnRatingBarChangeListener(new OnRatingBarChangeListener() { | |
@Override | |
public void onRatingChanged( | |
RatingBar ratingBar, float rating, | |
boolean fromTouch) { | |
final int numStars = ratingBar | |
.getNumStars(); | |
ratingText.setText(rating + "/" + numStars); | |
} | |
}); | |
} else { | |
Toast.makeText(getApplicationContext(), "Login to rate it", | |
Toast.LENGTH_LONG).show(); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment