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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:08:08+00:00 2026-05-19T03:08:08+00:00

In my android project I have an image that i want to rotate it

  • 0

In my android project I have an image that i want to rotate it and create animation for long time.
I can run program and it works fine. but I don’t know how can I stop it. if you know please tell me.

Thanks

This is my code, I have a menu with two items, When I click on Start item, startAnimation function runs and when I click on Stop item, stopAnimation runs.:

public class Hypnagogic extends Activity 
{
    ImageView imView;
    Animation an;

    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        imView = (ImageView)findViewById(R.id.imView);
    }

    private void startAnimation()
    {
        an = AnimationUtils.loadAnimation(this, R.anim.spin);
        imView.startAnimation(an);
    }

    private void stopAnimation()
    {
        ;//there is no any stop function!
    }
}

also, in res/anim I put spin.xml that is my animation

<?xml version="1.0" encoding="utf-8"?>

<set>
    <rotate
    android:fromDegrees="0"
    android:toDegrees="-18000"
    android:pivotX="50%"
    android:pivotY="50%"
    android:duration="50000" />
</set>

  • 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-19T03:08:09+00:00Added an answer on May 19, 2026 at 3:08 am

    EDIT: I see. Okay, try the clearAnimation() method associated with the View class. You can call it directly on your ImageView, I’m almost certain this should work for your case:

    imView.clearAnimation();
    

    What have you tried? AnimationDrawable has a stop() method. You need to post how you’re creating/starting the animation.

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

Sidebar

Related Questions

I have a Android project for SDK1.5 and now I want to convert it
I have an Android project that branched into three different applications, app-1 , app-2
Background I have an Android project that has a database with two tables: tbl_question
I my project I have a class that in this class I want to
i have a error on my android project that i cant solve. I have
I have a custom drawable in my android project that should be the background
I have a android project and within that project I have a folder that
My android project uses many images, and I have images for different DPIs as
I am currently working on an android project and I have an activity, lets
I have an Android project I've inherited from another developer. The original code was

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.