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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:31:33+00:00 2026-06-10T22:31:33+00:00

I am new to animations on Android and I seem to be having a

  • 0

I am new to animations on Android and I seem to be having a simple issue… I have a splash/loading screen, which I want to fade out when it’s done, then show the app.

My layout looks something like this (the styles just set a background image):

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/homeParentContainer"
    style="@style/LayoutWithBgStyle"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/homeSplashLayout"
        style="@style/LayoutWithSplashStyle"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true" >
    </LinearLayout>

    <LinearLayout
        android:id="@+id/homeMainLayout"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:orientation="vertical"
        android:visibility="gone" >
    </LinearLayout>
</RelativeLayout>

Then I tried two different approaches to fading the splash screen out and setting the main screen visible:

final Animation fadeOut = AnimationUtils.loadAnimation(this, android.R.anim.fade_out);
final View splash = findViewById(R.id.homeMainLayout);
fadeOut.setAnimationListener(new AnimationAdapter()
{
    @Override
    public void onAnimationEnd(final Animation animation)
    {
        splash.setVisibility(View.GONE);
        findViewById(R.id.homeMainLayout).setVisibility(View.VISIBLE);
    }

    /** And the other two methods */

});
splash.startAnimation(fadeOut);

Then I tried my own animation:

final AlphaAnimation fadeOut = new AlphaAnimation(1.0F,  0.0F);
fadeOut.setDuration(1000);
final View splash = findViewById(R.id.homeMainLayout);
fadeOut.setAnimationListener(new AnimationListener()
{
    @Override
    public void onAnimationEnd(final Animation animation)
    {
        splash.setVisibility(View.GONE);
        findViewById(R.id.homeMainLayout).setVisibility(View.VISIBLE);
    }

    /** And the other two methods */

});
splash.startAnimation(fadeOut);

And I get to the startAnimation code, but the animation never seems to start, and I never get the onAnimationEnd() call. What have I forgotten to include to get the animation to actually run?

  • 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-10T22:31:35+00:00Added an answer on June 10, 2026 at 10:31 pm

    I have been a careless programmer.

    final View splash = findViewById(R.id.homeMainLayout);
    

    should actually read:

    final View splash = findViewById(R.id.homeSplashLayout);
    

    because fading out something that is invisible is not what I had intended.

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

Sidebar

Related Questions

I'm new to Android development, I have created an animation which I have associated
I'm very new to Android. I want to pop up a transparent screen when
I am new to iPhone developer, I want to implement different Animations on button
I have a very strange problem with Android animations, I tried many different approaches
I'm new to Android animation, i want to know the details for Android animation.
I have a FrameLayout in which I have placed two identical TextViews. I want
I am really new to animations in android (and pretty much anything else). Is
I am relatively new to Android Animation and Gestures. I have 15 images that
I'm having some issues with Android Animations with the ViewAnimator. Here is my code
I'm kinda new to building apps on Android. I do have some Java developing

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.