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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:00:19+00:00 2026-06-16T04:00:19+00:00

Im trying to draw a smaller circle within another circle. It seems pretty simple

  • 0

Im trying to draw a smaller circle within another circle.
It seems pretty simple but Im having trouble with this and couldnt find an answer.
The code im using is:

    ShapeDrawable biggerCircle= new ShapeDrawable( new OvalShape());
    biggerCircle.setIntrinsicHeight( 60 );
    biggerCircle.setIntrinsicWidth( 60);
    biggerCircle.setBounds(new Rect(0, 0, 60, 60));
    biggerCircle.getPaint().setColor(Color.BLUE);

    ShapeDrawable smallerCircle= new ShapeDrawable( new OvalShape());
    smallerCircle.setIntrinsicHeight( 10 );
    smallerCircle.setIntrinsicWidth( 10);
    smallerCircle.setBounds(new Rect(0, 0, 10, 10));
    smallerCircle.getPaint().setColor(Color.BLACK);
    smallerCircle.setPadding(50,50,50,50);

    LayerDrawable composite1 = new LayerDrawable(new Drawable[] biggerCircle,smallerCircle,});

But that didnt work, what happens is that the smaller circle get as big as the the bigger circle. So the only thing showing is as black circle with the size of the biggerCircle.
I would apriciate if someone could help. Thanks in advance.

  • 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-16T04:00:23+00:00Added an answer on June 16, 2026 at 4:00 am

    Change the order,

    Drawable[] d = {smallerCircle,biggerCircle};
    
    LayerDrawable composite1 = new LayerDrawable(d);
    

    try like this

            ShapeDrawable biggerCircle= new ShapeDrawable( new OvalShape());
            biggerCircle.setIntrinsicHeight( 60 );
            biggerCircle.setIntrinsicWidth( 60);
            biggerCircle.setBounds(new Rect(0, 0, 60, 60));
            biggerCircle.getPaint().setColor(Color.BLUE);
    
            ShapeDrawable smallerCircle= new ShapeDrawable( new OvalShape());
            smallerCircle.setIntrinsicHeight( 10 );
            smallerCircle.setIntrinsicWidth( 10);
            smallerCircle.setBounds(new Rect(0, 0, 10, 10));
            smallerCircle.getPaint().setColor(Color.BLACK);
            smallerCircle.setPadding(50,50,50,50);
            Drawable[] d = {smallerCircle,biggerCircle};
    
            LayerDrawable composite1 = new LayerDrawable(d);
    
            btn.setBackgroundDrawable(composite1);  
    

    enter image description here

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

Sidebar

Related Questions

I'm trying to draw a circle in c using opengl, that's smaller than the
I'm trying to draw simple 2d things in my JSP application. I found this
I'm trying to draw custom UI (a path in this case) on top of
I am trying to draw a picture to the window but it is only
I was trying to draw a shaded triangle, but I get wrong colors. Here's
I'm trying to draw a simple line graph which would use values from the
I am trying to draw a figure something like this: I need to have
I'm trying to draw on a map using markers. The problem I'm having is
I am trying to draw a circle using mouse on the canvas using mouse
I guess this problem is really about performance, but I'm trying to get a

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.