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 3722046
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:45:52+00:00 2026-05-19T05:45:52+00:00

I hope this is a simple problem. I have a seekbar that I want

  • 0

I hope this is a simple problem.

I have a seekbar that I want to limit the range it can be set to. This range can change depending on other factors (the values of other seekbars, etc.)

The seekbar is a simple 0 to 100 range and defines a percentage. I need this value to be a minimum which can range from 0% (normal seekbar operation) to a higher value (let’s say 50% for example).

The code does its calculation and determines the minimum value depending on other variables.

When I drag the seekbar below this threshold I want it to reset its value to that minimum. Here’s some sample code

seek6.setOnTouchListener( new OnTouchListener() { 

@Override
public boolean onTouch(View v, MotionEvent event) {
    if(event.getAction() == MotionEvent.ACTION_UP) {        
        int CurrentLevel = seek6.getProgress();
        if (CurrentLevel < 30) CurrentLevel = 30;
        seek6.setProgress(CurrentLevel);
            }

    return false;
    }   
     });

So in this sample if I drag below 30, the value will be set back up to 30.

If I drag above 30 everything is fine. If I drag below the 30 mark, then the seekbar GetValue() is coming back as 30, but the seekbar shows the lower value.

For example, if I drag it all the way down to 0 the return value is 30, but it shows 0 on screen.

How can I get the seekbar to re-display at the 30 position automatically?

I’ve tried to change the focus, update the seekbar from another method. Nothing has worked so far.

Any ideas?

  • 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-05-19T05:45:53+00:00Added an answer on May 19, 2026 at 5:45 am

    I have my answer after many gruelling hours of searching.

    seek6.setOnSeekBarChangeListener(new OnSeekBarChangeListener(){
        public void onStopTrackingTouch(SeekBar seekBar){               
            // TODO My code goes here
    
            int CurrentLevel = seek6.getProgress();
            if(CurrentLevel < 30)
                CurrentLevel = 30;
            seek6.setProgress(CurrentLevel);
    
        }
    
        public void onStartTrackingTouch(SeekBar seekBar){}
    
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){}
    });
    

    Thanks to anyone who has been researching this anyway.

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

Sidebar

Related Questions

I have quite simple problem in SQL Server: User can have 12 items that
Hope this makes sense... Is there a simple way to return a set of
I hope there's a simple solution for this: I have a table where each
I hope this I can explain what I am trying to achieve: I want
I have this simple problem. I'll try to explain with a sample code An
I hope this isn't too vague, but I'm stuck on a problem that has
simple problem ( I hope) I have a div: with css: .break{position:relative;height:1px;background-color:#555555;margin:5px 10px 10px
I have a fairly simple regex problem for a little personal experiment that I
I hope this is a simple one, but I can't seem to be able
I have a problem with generics in C# I hope you can help me

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.