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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:43:32+00:00 2026-05-28T00:43:32+00:00

I have a question that I have a splash screen in my android app

  • 0

I have a question that I have a splash screen in my android app in which I am using thread to wait for 8 seconds, it is running fine in 1.6,2.1,2.2,2.3.3, 3.0, 3.1 but returns error when I want to run the same in 4.0.3 version of android, I don’t know why? Please suggest me the right solution for the same. Below I mentioned error stack and my code also.

Error Stack:

01-05 10:16:06.417: E/AndroidRuntime(589): FATAL EXCEPTION: Thread-75
01-05 10:16:06.417: E/AndroidRuntime(589): java.lang.UnsupportedOperationException
01-05 10:16:06.417: E/AndroidRuntime(589):  at java.lang.Thread.stop(Thread.java:1076)
01-05 10:16:06.417: E/AndroidRuntime(589):  at java.lang.Thread.stop(Thread.java:1063)
01-05 10:16:06.417: E/AndroidRuntime(589):  at com.shipface.common.SplashScreen$1.run(SplashScreen.java:34)

Code:

public class SplashScreen extends Activity {
    /** Called when the activity is first created. */
    Thread splash;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        splash =  new Thread(){
            @Override
            public void run(){
                try {

                    synchronized(this){
                    // Wait given period of time or exit on touch
                        wait(4000);
                        Intent intent = new Intent(SplashScreen.this,HomeActivity.class);
                        startActivity(intent);
                        finish();
                    }
                }
                catch(InterruptedException ex){                    
                }

                finish();


                stop();                    
            }
        };


        splash.start();   
    }
}
  • 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-28T00:43:33+00:00Added an answer on May 28, 2026 at 12:43 am

    Everybody’s already said where the exception is coming from (Thread.stop()), so I’ll leave that alone…

    By far, the easiest method is to not create a Thread for this purpose at all; even an AsyncTask is over-doing it. This is what the Handler was created for (or even CountDownTimer, but Handler is cleaner, IMO).

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        Handler handler = new Handler();
        Runnable action = new Runnable(){
            @Override
            public void run(){
                Intent intent = new Intent(SplashScreen.this,HomeActivity.class);
                startActivity(intent);
                finish();
            }
        };
    
        handler.postDelayed(action, 8000);  
    }
    

    The Handler will even run the action on the main thread for you, where that code should pretty much be called anyway.

    HTH

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

Sidebar

Related Questions

I have a Splash Screen for an Android Project in which I have to
I have a splash screen image that I display with splash.showFullScreen() but it doesn't
I have a question that may be quite naive, but I feel the need
I have a question that I'm ashamed to ask, but I'm going to have
A question that seems to have quite a few options for Python, but none
Like many people, I have a splash screen that animates off to reveal the
I hava a WP 7.5 app. I have a splash screen and then comes
I have a task that takes about 10 seconds on the UI thread during
My app has a splash screen activity and that starts an intent for the
Question: I have a question that is apparently not answered by this already-asked Bash

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.