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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:30:06+00:00 2026-05-27T05:30:06+00:00

I am using 5-6 threads for displayng one animation at a time.I am using

  • 0

I am using 5-6 threads for displayng one animation at a time.I am using translate animations as well as frame animations. Is this a good idea? What is the best way to do it? My code is give below.

Handler handler1 = new Handler();        
handler1.postDelayed(new Runnable() {
  public void run() {
    Animation animation = new TranslateAnimation(0 ,0 ,0 ,100 );
    animation.setDuration(800);
    ImageView rimg2 = (ImageView) findViewById(R.id.rainfall);
    animation.setRepeatCount(-1);
    rimg2.startAnimation(animation);

    Animation animation1 = new TranslateAnimation(-290, 290,0, -150);
    animation1.setDuration(35000);
    ImageView rimg = (ImageView) findViewById(R.id.cloud1);
    rimg.setVisibility(View.VISIBLE);
    animation1.setRepeatCount(-1);
    rimg.startAnimation(animation1);
  } 
},0);

Handler handler2 = new Handler();
handler2.postDelayed(new Runnable() {
  public void run() {
    Animation animation = new TranslateAnimation(0 ,0 ,0 ,100 );
    animation.setDuration(800);
    ImageView rimg3 = (ImageView) findViewById(R.id.drops);
    animation.setRepeatCount(-1);
    rimg3.startAnimation(animation);
    rimg3.setVisibility(View.VISIBLE);
  }
},1000);

Handler handler3 = new Handler();
handler3.postDelayed(new Runnable() {
  public void run() {
    Animation animation = new TranslateAnimation(0 ,0 ,-250 ,10 );
    animation.setDuration(800);
    ImageView rimg2 = (ImageView) findViewById(R.id.rainfall1);
    animation.setRepeatCount(-1);
    rimg2.startAnimation(animation);
    rimg2.setVisibility(View.VISIBLE);
    }
},5000);

Handler handler4 = new Handler();
handler4.postDelayed(new Runnable() {
  public void run() {
    Animation animation = new TranslateAnimation(0 ,0 ,-150 ,10 );
    animation.setDuration(800);
    ImageView rimg3 = (ImageView) findViewById(R.id.drops1);
    animation.setRepeatCount(-1);
    rimg3.startAnimation(animation);
    rimg3.setVisibility(View.VISIBLE);
    }
},10000);

Handler handler5 = new Handler();
handler5.postDelayed(new Runnable() {
  public void run() {
    Animation animation1 = new TranslateAnimation(-290, 290,0, -150);
    animation1.setDuration(35000);
    ImageView rimg = (ImageView) findViewById(R.id.cloud2);
    rimg.setVisibility(View.VISIBLE);
    animation1.setRepeatCount(-1);
    rimg.startAnimation(animation1);
  }
},15000);
  • 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-27T05:30:07+00:00Added an answer on May 27, 2026 at 5:30 am

    Unless there is a reason not shown in your code sample, you do not need to post Runnables to run these animations. You can start the animations from the main UI thread. For more details, check out the documentation here:

    http://developer.android.com/guide/topics/graphics/view-animation.html

    and here

    http://developer.android.com/reference/android/view/animation/Animation.html

    You can also set the StartOffset if you want to stagger the animation start times.

    And if you want to do something when the animation ends, you can use Animation.setAnimationListener

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

Sidebar

Related Questions

Visual Studio C++ 2008 I am using threads. However, I have this warnings and
When using threads I sometimes visualise them as weaving together 3 or more dimensional
Today I had to fix some older VB.NET 1.0 code which is using threads.
I would like to implement a parallel version of the code below using threads
Using POSIX threads & C++, I have an Insert operation which can only be
I am using multiple threads in my application using while(true) loop and now i
I am using ACE threads and need each thread to have its own int
I'm using multiple threads in my application. Basically I have a combo box and
Is here any performance benefit to using multiple threads on a computer with a
Sample code that shows how to create threads using MFC declares the thread function

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.