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

The Archive Base Latest Questions

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

How to start an activity after the animation has ended. I have added android:oneshot=true

  • 0

How to start an activity after the animation has ended.
I have added android:oneshot=”true” in the xml but how to start a new activity
after this animation has stopped.I have attached the entire code below.
Please let me know how to start new activity.

    package com.appsolut.example.animation;


    import android.app.Activity;
    import android.content.Intent;
    import android.graphics.drawable.AnimationDrawable;
    import android.os.Bundle;
    import android.widget.ImageView;

    public class Animation extends Activity {

    ImageView animation;


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


    }

    @Override

    public void onWindowFocusChanged (boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        AnimationDrawable frameAnimation = 
            (AnimationDrawable) animation.getBackground();

        if(hasFocus) {          

            frameAnimation.start();


        } else {
            frameAnimation.stop();

        }

    }


    public void onStart() {
        {
            super.onStart();

            animation = (ImageView)findViewById(R.id.imageAnimation);

            animation.setBackgroundResource(R.drawable.animation);      

        }
    }
}

animation.xml

 <?xml version="1.0" encoding="utf-8"?>
    <animation-list xmlns:android="http://schemas.android.com/apk/res/android"
        android:oneshot="true"   >

        <item android:drawable="@drawable/img00000" android:duration="500" />
        <item android:drawable="@drawable/img00001" android:duration="500" />
        <item android:drawable="@drawable/img00002" android:duration="500" />
        <item android:drawable="@drawable/img00003" android:duration="500" />
        <item android:drawable="@drawable/img00004" android:duration="500" />
        <item android:drawable="@drawable/img00005" android:duration="500" />
        <item android:drawable="@drawable/img00006" android:duration="500" />
        <item android:drawable="@drawable/img00007" android:duration="500" />
        <item android:drawable="@drawable/img00008" android:duration="500" />
        <item android:drawable="@drawable/img00009" android:duration="500" />
        <item android:drawable="@drawable/img00010" android:duration="500" />

    </animation-list>
  • 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-28T05:15:22+00:00Added an answer on May 28, 2026 at 5:15 am

    Use and AnimationListener on your animation to do whatever you want on its onAnimationEnd() method.

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

Sidebar

Related Questions

Having trouble to start a new activity after progressbar have loaded. Im getting stucked
I'm new in android development. I have been trying to start a new activity
this button is shown on my start activity. After pressing it a new activity
Basically I want to have a button to start a new activity after login.
I have an activity that starts after a certain time. Once this activity starts,
I have this situation where i have to start an activity from my mainActivity.
I am new to android, i want to as start an activity when i
When I run my code, Unable to start activity ComponentInfo: android.database.sqlite.SQLiteException: near /: syntax
I know that we can start new activity with the steps as follows :
I need to start the activity AlarmReceiver after 10 seconds (for example). I need

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.