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

  • Home
  • SEARCH
  • 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 908361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:42:22+00:00 2026-05-15T16:42:22+00:00

My animation works and when the thread ends, the intent for the next screen

  • 0

My animation works and when the thread ends, the intent for the next screen fires, but it won’t fire from the end of the animation. I put log entries for all of the AnimationListener's callbacks (only End is in this listing), but none get logged.

public class PromoActivity extends Activity implements AnimationListener {
    protected boolean _active = true;
    protected int _splashTime = 5000; // time to display the splash screen in ms

    private static final float ROTATE_FROM = 0.0f;
    private static final float ROTATE_TO = -10.0f * 360.0f;// 3.141592654f * 32.0f;
    private static final String TAG = "PromoActivity";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Thread promoThread = new Thread() {
            @Override
            public void run() {
                try {
                    ImageView favicon = (ImageView) findViewById(R.id.favicon);

                    RotateAnimation r; // = new RotateAnimation(ROTATE_FROM, ROTATE_TO);
                    r = new RotateAnimation(ROTATE_FROM, ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                    r.setDuration((long) 2*1500);
                    favicon.startAnimation(r);

                    RotateAnimation q;
                    q = new RotateAnimation(ROTATE_FROM, -ROTATE_TO, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
                    q.setDuration((long) 2*1500);
                    q.setRepeatCount(0);
                    TextView mobiText = (TextView) findViewById(R.id.logotext_mobi);
                    mobiText.startAnimation(q);

                    TextView dawgText = (TextView) findViewById(R.id.logotext_bob);
                    dawgText.startAnimation(q);

                    int waited = 0;
                    while (_active && (waited < _splashTime)) {
                        sleep(100);
                        if (_active) {
                            waited += 100;
                        }
                    }
                } catch (InterruptedException ex) {

                } finally {
                    finish();
                    startActivity(new Intent("com.mobibob.promo.AboutActivity"));
                    stop();
                }
            }
        };
        promoThread.start();

    }

    @Override
    public void onAnimationEnd(Animation animation) {
        Log.d(TAG, "onAnimationEnd");
        startActivity(new Intent("com.mobibob.promo.AboutActivity"));
    }
}
  • 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-15T16:42:23+00:00Added an answer on May 15, 2026 at 4:42 pm

    You’re not calling Animation#setAnimationListener anywhere. You need to call r.setAnimationListener(PromoActivity.this) and/or q.setAnimationListener(PromoActivity.this) for the listener to be called.

    Something to keep in mind is that you have two animations and they may not finish at exactly the same time. So you probably want to keep track of how many times your listener was called and only call startActivity when the number of animations that was supposed to end has been reached.

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

Sidebar

Related Questions

I have a menu with an animation going on, but I want to disable
This question is similar to this one about animation queues , but the answers
Are there any jQuery 1.3 animation-transitions that work in both Firefox 3 and IE7?
I work at an animation studio that does several productions in Flash. Probably one
I am using slideDown animation to show some divs in a newly added table
I have an animation and I want it to play it just only once.
Is there an animation format supported in Qt (using v4.4) that will support a
What is a good way to perform animation using .NET? I would prefer not
Is there a preferred way to handle animation when using Flex -- For instance,
I need to knock out a quick animation in C#/Windows Forms for a Halloween

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.