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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:59:57+00:00 2026-05-26T17:59:57+00:00

I am looking for a way to use a seeker bar as a slider

  • 0

I am looking for a way to use a seeker bar as a slider to move lines up and down the screen so as to be able to create animated graphs.
At the moment I have got this far:

I have created an activity which uses main layout.
On this main layout is a seeker bar and a custom view called graph.
I have referred to the Graph class by using:

<com.mypackagename.Graph
Android:id=”@+id/graph”/>

I have created a corresponding Graph class which extends View and in it I have drawn a red horizontal line using:

@Override public void onDraw(Canvas canvas){ 

paint = new Paint(); 
paint.setARGB(255, 255, 0, 0); 
paint.setStrokeWidth(2); 
paint.setStyle(Style.STROKE); 
canvas.drawLine(0, 200, 200, 200, paint); 

          }

My problem is how can I get the seeker bar to update this line?

I have written code for the seeker bar as follows:

my_seekerbar.setOnTouchListener(new SeekBar.OnTouchListener() 
{ 
    public boolean onTouch(View v, MotionEvent arg1) 
    { 
        View parent = (View)v.getParent(); 
                       SeekBar seekBar = (SeekBar)v; 
            int progress = seekBar.getProgress(); 



        } 
        return false; 
     } 
}); 

I am trying to use the value of progress to set the y-co-ordinate of my line.
I have been wrestling with this problem for a long time.
Am I on the wrong track?

  • 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-26T17:59:57+00:00Added an answer on May 26, 2026 at 5:59 pm

    In onTouch() you can modify a member variable which is accessible in onDraw().

    When the seekbar is moved, force a redraw of the view by calling invalidate(), this will call onDraw() where you can modify the line.

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

Sidebar

Related Questions

I'm looking for a way to use a JavaScript function to create a new
I am looking for a way to be able to use VisualSVN with my
I've been looking for a way to use PHP's SSH2 to create a sort
My problem is that I was looking for way to use both storyboard and
I'm looking for a way to use your location to determine whether you need
I am looking for a way to use a UILabel (or something similar) to
I am looking for a way to use a WCF WebServiceHost without having to
I'm looking for a way to use some variant of vsnprintf() with a buffer
I'm looking for a way to use CSS to style everything between the first
I'm looking for the best way to use a duration field in a Rails

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.