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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:00:42+00:00 2026-06-13T05:00:42+00:00

I am tring to make a circle pop after 3 seconds and disappear in

  • 0

I am tring to make a circle pop after 3 seconds and disappear in 3 seconds in a loop.
this program pop the circle after 3 seconds but I have problem with the 3 seconds duration beteen.

it will be great if some one will have a solution for me

public class TestView extends View{

private boolean isPop;

public TestView(Context context) {
    super(context);

    isPop=false;
    // TODO Auto-generated constructor stub
}

@Override
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    canvas.drawColor(Color.RED);

    Paint circle = new Paint();
    circle.setColor(Color.BLUE);
    if (isPop){
        canvas.drawCircle(100, 100, 40, circle);
    }
    invalidate();

    CountDownTimer count = new CountDownTimer(3000, 1000) {

        public void onTick(long millisUntilFinished) {
        }

        public void onFinish() {

            CountDownTimer count = new CountDownTimer(3000, 1000) {

                public void onTick(long millisUntilFinished) {
                    isPop=true;

                }

                public void onFinish() {

                    isPop=false;

                }

             }.start();             
        }

     }.start();
  • 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-13T05:00:43+00:00Added an answer on June 13, 2026 at 5:00 am

    Consider using the Handler that comes with every View instead:

    class TestView extends View { 
        private Paint circle = new Paint();
        private boolean isPop = false;
        private Runnable everyThreeSeconds = new Runnable() {
            public void run() {
                // Do something spiffy like...
                isPop = !isPop;
                invalidate();
    
                // Don't forget to call you next three second interval!
                postDelayed(everyThreeSeconds, 3000);
            }
        };
    
        public TestView(Context context) {
            this(context, null);
        }
    
        public TestView(Context context, AttributeSet attrs) {
            super(context, attrs);
            circle.setColor(Color.BLUE);
            post(everyThreeSeconds);
        }
    
        @Override
        protected void onDraw(Canvas canvas) {
            super.onDraw(canvas);
            canvas.drawColor(Color.RED);
    
            if (isPop){
                canvas.drawCircle(100, 100, 40, circle);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am tring to make two columns having same height but failed. How to
I'm trying to make a circle shape clipping on a CCSprite in cocos2d, after
I'm trying to make a drag curver with Raphael. Please look for this: r.circle(x,
I have been trying to make a cylinder in renderscript. This is the code
I have been searching for an answer to this for two days now, but
I'm trying to make an adaptable Web page where I have some circles on
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to make a simple number clicker control for BlackBerry 6/7, like this: At
Trying to make this simple applet - the first part just creates a simple
I am trying to make a basic drawing program with a RadioButton to determine

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.