Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8472881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:11:51+00:00 2026-06-10T17:11:51+00:00

I am wanting to have a seekbar that when the user slides the thumb

  • 0

I am wanting to have a seekbar that when the user slides the thumb pad it adds/subtracts by quarter inch increments. It would need to start at 0′-0.0″ and go up to 20′-0.0″ I am new to programming and what I have found is that the seekbar only accepts “int” and not double (which is what I need). So would I need to create and array with every individual value and then get the results of the progress bar and then pull that number from my array to display in a textView or is there a way to have the progress bar increment up by quarter inches?

Thanks for your time

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:11:52+00:00Added an answer on June 10, 2026 at 5:11 pm

    Since I did not get a response for another solution other than what I stated in my question here is how I coded it in case someone else might need to know.

    ArrayList<String> arrayListName = new ArrayList<String>();    
    for (int i = 0; i < 20; i++) {
            for (int ii = 0; ii < 12; ii++) {
                for (int iii = 0; iii < 4; iii++) {
                    arrayListName.add(i + "'-" + ii + "." + iii + '"');
                } // end nested loop iii
            } // end nested loop ii
        } // end nested loop i
        String twenty = "20'-0.0\"";
        arrayListName.add(twenty);
        int lengthOfArrayListName = arrayListName.size(); 
    

    The above code generates an array with 960 elements in it. I then used the next line to set the max for the progress bar

    seekBarName.setMax(lengthOfArrayListName - 1);
    

    you need to subtract 1 from the length because the array starts a 0 not 1 or you will get an arrayoutofbounds FC

    next in the onProgressChanged for the SeekBar I used this line to use the position value of the seekbar to then set the text of a textView from the arrayListName.

    textViewName.setText(arrayListName.get(progress));
    

    This method works just fine except that with such a large number set to choose from the user may (most likely will not be able to) stop the thumb button right on the number they want. So I added a “+” and “-” button under the seekbar that increments the progress by 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wanting to have a strongly typed user control that accepts the class PaginatedList<T>
I am wanting to have the EXACT same data across two WordPress sites that
EDIT: See my answer below--> I am wanting to have a view that when
I have an array that is produced from people wanting to reserve a time
Hey I'm wanting to have an integrity check on a software that will be
Ok Im building AN API but also wanting to have that API used by
I have a method that returns byte[] but for now would like to avoid
I am wanting to have a view table that aggregates rows from four tables.
I have a client that is wanting to have jquery.colorbox and wants the background
I am wanting to have a group of components that are draggable... eg.. 1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.