Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set SeekBar progress with a long integer? (or alternatives)

I need some help with an Android app. I want to use SeekBars to set a certain value but the value should be able to be a long (because I need such high numbers). Are there good custom SeekBars to import? (GitHub link would be great)

The normal SeekBar only supports normal integers as far as I know and casting to int is no option.

like image 474
Jonathan Avatar asked Jan 30 '26 22:01

Jonathan


1 Answers

You can instead use percentage formula.

  • Set max of SeekBar to 100,
  • Current position equals (int)current_long/total_long * 100
like image 129
asim Avatar answered Feb 01 '26 14:02

asim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!