Do I create a create SeekBar that uses decimal values?
For example, it would display
0.0, 0.1, 0.2, 0.3, …, 5.5, 5.6, 5.7, …, 9.9, 10.0
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A SeekBar defaults to a value between 0 and 100. When the
onProgressChangedfunction is called from the SeekBar’s change listener, the progress number is passed in theprogressparameter.If you wanted to convert this progress into a decimal from 0.0 -> 10.0 to display or process, all you would need to do is divide the progress by 10 when you receive a progress value, and cast that value into a float. Here’s some example code: