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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:14:10+00:00 2026-05-23T21:14:10+00:00

In my application I have 6 buttons. In onCreate() , I have a startAnimation()

  • 0

In my application I have 6 buttons. In onCreate(), I have a startAnimation() which will perform animation for the appearance of the buttons. After the call to this method I have setOnclickListener()s for each button.

My code in the onCreate() looks like this:

    startAnimations();

    b1.setOnClickListener(this);
    b2.setOnClickListener(this);
    b3.setOnClickListener(this);
    b4.setOnClickListener(this);
    b5.setOnClickListener(this);
    b6.setOnClickListener(this);

The Problem is: when I tested my application and while the animation starts, I can click any button even if the button didn’t show yet. I mean, I can click in the button place and the action related to that button will start.

I want to force the buttons to NOT respond to the clicks until the whole animation is over.

Can I do that?

  • 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-23T21:14:11+00:00Added an answer on May 23, 2026 at 9:14 pm

    Why don’t you disable your buttons onCreate or by defaut and then when animations ends, enable it.

     findViewById(R.id.button1).setEnable(false);
     findViewById(R.id.button1).setEnable(false);
     ....   
     final RelativeLayout l = (RelativeLayout) findViewById(R.id.group_band);
     Animation a = new TranslateAnimation(0, 0, -100, 0);
     a.setDuration(200);
     a.setAnimationListener(new AnimationListener() {
    
                    public void onAnimationEnd(Animation animation) {
                        findViewById(R.id.button1).setEnable(true);
                        findViewById(R.id.button2).setEnable(true);
                                                 ....
                    }
    
                    public void onAnimationRepeat(Animation animation) {
    
                    }
    
                    public void onAnimationStart(Animation animation) {
    
                    }
    
                });
    
     l.startAnimation(l);
    

    What do you think?

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

Sidebar

Related Questions

I have an application which has questions. After answer all the questions, score will
In my application I have some link buttons there but when I right click
I have a group of radio buttons in my Swing application that have a
In my application I have several activities, the main screen has 4 buttons that
I have an application that has a list of buttons and has customized tooltips.
I have a swing application that includes radio buttons on a form. I have
I have a couple of UI elements such as buttons in my web application.
In the entry form of my wpf application, I have a list of buttons
A small - little question. I have seen many application having buttons like following.
I am writing a test application which consists of: 2 buttons 1 Edittext 1

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.