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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:32:18+00:00 2026-06-14T20:32:18+00:00

I have an app that is working fine when the dev option Don’t keep

  • 0

I have an app that is working fine when the dev option Don’t keep activities is ON.

When is OFF though,

every time the app goes to background and resumes, the onCreate function is called again.
In there I am re-creating the last app state.

Now the problem is that a simple animation that happens on user action, doesn’t start and the animation handlers never called.

It seems like the animation is ignored. And this only happens when the activity is killed and created again.

And the weirdest part is that I have 4 animations, 2 for one imageview (opening, closing) and 2 for another imageview (opening, closing).

And this happens onmly on the opening animations.

Could you help me out?

the animation xmls (for one of the opening/closing anims)

redShow animation

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
  android:interpolator="@android:anim/linear_interpolator">
  <alpha
      android:fromAlpha="0.1"
      android:toAlpha="1.0"
      android:duration="800"
      /> 
  <scale android:fromXScale="0.0"
      android:toXScale="1.0"
      android:fromYScale="0.0"
      android:toYScale="1.0"
      android:pivotX="50%"
      android:pivotY="50%"
      android:duration="800">

  </scale>
</set>

redHide animation

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
  android:interpolator="@android:anim/linear_interpolator">
  <alpha
      android:fromAlpha="1.0"
      android:toAlpha="0.0"
      android:duration="300"
      />
  <scale android:fromXScale="1.0"
      android:toXScale="0.0"
      android:fromYScale="1.0"
      android:toYScale="0.0"
      android:pivotX="50%"
      android:pivotY="50%"
      android:duration="300">

  </scale>
</set>

the code (at onCreate) where I am initialising stuff

red = (ImageView) findViewById(R.id.red);

redHide = AnimationUtils.loadAnimation(this, R.anim.red_hide);
redHide.setFillAfter(true);
redHide.setAnimationListener(this);

redShow = AnimationUtils.loadAnimation(this, R.anim.red_show);          
redShow.setFillAfter(true);
redShow.setAnimationListener(this);

the handlers and the methods I am callling

private void showRed() {
    red.startAnimation(redShow); //this is the one that is not happening
}

private void hideRed() {
     red.startAnimation(redHide);
}

@Override
public void onAnimationEnd(Animation a) {   
}

@Override
public void onAnimationRepeat(Animation a) {
}

@Override
public void onAnimationStart(Animation a) {
}

G

  • 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-14T20:32:20+00:00Added an answer on June 14, 2026 at 8:32 pm

    Things you could try are:

    • init the animations in onResume() instead.
    • Call clearAnimation() before you start each animation.
    • Try to animate without fillAfter(), maybe the animation has been locked to it’s latest state somehow.

    Just some ideas..

    A blinking red warning lamp went off when you wrote that you are recreating the last app state since the code you are showing to us looks just fine.

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

Sidebar

Related Questions

I have a rails app that is working fine except for one thing. When
I have this IPhone app underway that was working fine, then I installed OS
I have an existing iPhone app that was working fine in Xcode 4.0 prior
I have an MVC app that is working fine, but I now want to
Hi I have an app that is working fine on iOS5, now running the
I have an android app that is working perfectly fine on almost all the
I have written a universal app that's working fine on both iPhone (iPod Touch)
I have a rails app that was working fine with sqlite but upon switching
I have an android app that appears to be working fine - but I
I have an Android app that I had working a few months ago which

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.