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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:48:18+00:00 2026-06-05T02:48:18+00:00

I have a loading screen which closes after 5 secounds and then the app

  • 0

I have a loading screen which closes after 5 secounds and then the app starts. During the loading screen I want to have a frame by frame animation running on top of the background loading screen image. It’s a simple concept an has been used before by many applactions, i’m just not sure how to do it since i’m new to android and programming all together. Below is the code to the splash.java screen and i’ll include the code to the frenchsilk.java class so you can see how the animation works without any other code. (Yes the animation works already BY ITSELF ONLY SO FAR).

Splash.java

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Bundle;

public class Splash extends Activity {

    MediaPlayer ourSong;


@Override
protected void onCreate(Bundle PieLovesPie) {
    // TODO Auto-generated method stub
    super.onCreate(PieLovesPie);
    setContentView(R.layout.splash);
    ourSong = MediaPlayer.create(Splash.this, R.raw.sound2);
    ourSong.start();
    Thread timer = new Thread(){
        public void run(){
            try{
                      sleep(4800);

            } catch (InterruptedException e){
                e.printStackTrace();
            }finally{
    *I shortened these*     Intent open"appname" = new Intent"packageNameCode"
    *2 lines for space resonse* startActivity(open"appname");
            }
        }
    };
    timer.start();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    ourSong.release();
    finish();

}

}

Frenchsilk.java

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

public class FrenchSilk extends Activity {
/** Called when the activity is first created. */

AnimationDrawable mainanimation; 

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

    ImageView mainimage = (ImageView) findViewById(R.id.MainAnim); 
    mainimage.setBackgroundResource(R.anim.mainanim); 
    mainanimation = (AnimationDrawable) mainimage.getBackground(); 
//        mainanimation.start();  
}
public void onWindowFocusChanged (boolean hasFocus)  
{ 
    super.onWindowFocusChanged(hasFocus); 
//        AnimationDrawable frameAnimation = (AnimationDrawable) mainimage.getBackground(); 
//        if(hasFocus) { 
        mainanimation.start(); 
//        } else { 
//            mainanimation.stop(); 
//        } 
    } 
}

I commented a few things out with * (and // within the actual codeing process) becuase it was messing up the code line spacing. I was thinking that under the sleep(4800); line that a class or something might go there telling the animation to start or something.

  • 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-05T02:48:22+00:00Added an answer on June 5, 2026 at 2:48 am

    Ok so i figured it out myself. Just had to put the code into the respected places and the onWindow changed at the bottom of the main java file.

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

Sidebar

Related Questions

I have an app which when opened, displays a splash/loading screen. I had this
How can I full-screen browser window after loading the page? I have used code
I have the main activity which launches a loading screen activity. When the loading
I have a UINavigationController onto which I push a 'loading screen' UIViewController whilst I
I want a splash screen to show while the application is loading. I have
We have an application which starts on a logon page and then navigates to
I have a splash screen/loading screen that has .setVisibility() to GONE right after the
Is there a way to have an animated loading screen for my iPhone application
In my app, I have a loading view that sets up the app by
I have a ExpandableListView in which i am loading custom layouts in both group

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.