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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:03:58+00:00 2026-05-23T10:03:58+00:00

Any help with this? I have an error when I try to use the

  • 0

Any help with this? I have an error when I try to use the seekbar to change my paint brush width.
The error line is UNDER setStrokeWidth, saying “Is not applicable for the arguments (string)”

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.drawing_activity);




    setCurrentPaint();
    currentBrush = new PenBrush();

    drawingSurface = (DrawingSurface) findViewById(R.id.drawingSurface);
    drawingSurface.setOnTouchListener(this);
    drawingSurface.previewPath = new DrawingPath();
    drawingSurface.previewPath.path = new Path();
    drawingSurface.previewPath.paint = getPreviewPaint();


    redoBtn = (ImageButton) findViewById(R.id.redoBtn);
    undoBtn = (ImageButton) findViewById(R.id.undoBtn);

    redoBtn.setEnabled(false);
    undoBtn.setEnabled(false);


    //SEEKBAR THICKNESS CHANGE
    //
    //
    SeekBar seekBar = (SeekBar)findViewById(R.id.seekBar);
    final TextView seekBarValue = (TextView)findViewById(R.id.seekValue);

    seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener(){

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser){
            seekBarValue.setText(String.valueOf(progress));
            **currentPaint.setStrokeWidth(String.valueOf(progress));**
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar){

        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar){

        }
    });
    }
//END SEEKBAR THICKNESS



private void setCurrentPaint(){
    currentPaint = new Paint();
    currentPaint.setDither(true);
    currentPaint.setColor(0xFFFFFFFF);
    currentPaint.setStyle(Paint.Style.STROKE);
    currentPaint.setStrokeJoin(Paint.Join.ROUND);
    currentPaint.setStrokeCap(Paint.Cap.ROUND);
    currentPaint.setStrokeWidth(3);

}

private Paint getPreviewPaint(){
    final Paint previewPaint = new Paint();
    previewPaint.setColor(0xFFC1C1C1);
    previewPaint.setStyle(Paint.Style.STROKE);
    previewPaint.setStrokeJoin(Paint.Join.ROUND);
    previewPaint.setStrokeCap(Paint.Cap.ROUND);
    previewPaint.setStrokeWidth(3);
    return previewPaint;
}




public boolean onTouch(View view, MotionEvent motionEvent) {
    if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){
        drawingSurface.isDrawing = true;

        currentDrawingPath = new DrawingPath();
        currentDrawingPath.paint = currentPaint;
        currentDrawingPath.path = new Path();
        currentBrush.mouseDown(currentDrawingPath.path, motionEvent.getX(), motionEvent.getY());
        currentBrush.mouseDown(drawingSurface.previewPath.path, motionEvent.getX(), motionEvent.getY());


    }else if(motionEvent.getAction() == MotionEvent.ACTION_MOVE){
        drawingSurface.isDrawing = true;
        currentBrush.mouseMove( currentDrawingPath.path, motionEvent.getX(), motionEvent.getY() );
        currentBrush.mouseMove(drawingSurface.previewPath.path, motionEvent.getX(), motionEvent.getY());


    }else if(motionEvent.getAction() == MotionEvent.ACTION_UP){


        currentBrush.mouseUp(drawingSurface.previewPath.path, motionEvent.getX(), motionEvent.getY());
        drawingSurface.previewPath.path = new Path();
        drawingSurface.addDrawingPath(currentDrawingPath);

        currentBrush.mouseUp( currentDrawingPath.path, motionEvent.getX(), motionEvent.getY() );

        undoBtn.setEnabled(true);
        redoBtn.setEnabled(false);

    }

    return true;
}
  • 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-23T10:03:58+00:00Added an answer on May 23, 2026 at 10:03 am

    setStrokeWidth takes a float parameter, not a String. Use currentPaint.setStrokeWidth(progress);

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

Sidebar

Related Questions

Any help here would be greatly appreciated. I have this table hospital Nurse |
I can't seem to find any help on this but under the Net tab
I'm very new to this, so any help is appreciated. I'll use the Dinners/RSVPs
Hi Is there any error in this TRIGGER Statement.When ever i try to run
I would appreciate any help on this issue. Lets say I want to load
Any help most appreciated, this is driving me insane. I'm doing exactly what I
any help you can give is very gratefully accepted. I've been looking at this
I've been stuck on this issue for several days - any help is much
This is my first time on this site and I appreciate any help on
I'm hittig my head on this and i will be glad for any help.

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.