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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:39:56+00:00 2026-06-05T22:39:56+00:00

How to draw multiple circles horizontally in android, with some filled color. And I

  • 0

How to draw multiple circles horizontally in android, with some filled color.
And I want to change the color based on some server response.

Can anybody tell how to do this? I implemented like this to draw a circle.

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new SampleView(this));

    }
    public class SampleView extends View
    {
        public SampleView(Context context)
        {
            super(context);
            // TODO Auto-generated constructor stub
        }

        @Override
        protected void onDraw(Canvas canvas)
        {
             Paint mPaint = new Paint();
             mPaint.setColor(Color.RED);
             mPaint.setStyle(Paint.Style.FILL);
             canvas.drawCircle(30, 30, 10, mPaint);

        }
     }

I’m not able to get how to draw three more circles in the same line.
And how to change the color based on condition if I write like this.

  • 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-05T22:39:58+00:00Added an answer on June 5, 2026 at 10:39 pm

    You can choose two option, either have multiple view, each having a single circle or draw multiple circle in a single view. I’d prefer the first option, but since your need may vary, so I am explaining both the option.

    Option 1:
    Have a class variable named as color, which can work as a property where you can change the color based on default color of the view. Run a loop outside the view, may be in onCreate() to increament x coordinate, which can be passed to the drawCircle() method.

    Option 2
    You can have an ArrayList of color for every circle. Run a loop in onDraw() method, which changes the color and increment the x coordinate based on loop counter.

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

Sidebar

Related Questions

I want to draw multiple filled ellipses on/in some panel. Drawing single one isnt
I want to draw multiple circles on a map, using the Google Maps API
I want to Draw multiple line Graph with each line have different color and
I have a vector drawing app where users can draw lines using multiple quadratic
I'm using http://raphaeljs.com/ to try and draw multiple small circles. The problem I'm having
I want to set up multiple stencils in OpenGL and then draw into multiple
I have to draw a bitmap multiple times. It's loaded from file. I can
Now I'm doing a project which need draw multiple pie charts with text. Can
I'm trying to draw multiple circle arcs filled with different colors //-------------- draw ctx.beginPath();
Hey just wondering how I can draw multiple rectangle objects in C# but have

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.