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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:06:08+00:00 2026-06-03T01:06:08+00:00

I have a problem with running a thread on ICS 4.0.3 I made the

  • 0

I have a problem with running a thread on ICS 4.0.3

I made the apk and I have installed it both on 2.33 SE phone and Google Nexus S 4.0.3.

On SE the apk is running and loading as it’s supposed to. However, on Nexus I am getting an error and I have for close it. But i see the program running behind.
i have tried to remove the thread(loading screen, splash picture) from the code and run it again on Nexus, and it could run. So i discover my problem is on thread, onCreate thread starting. its any kind of difference from 2.33 to 4.0.3 ?

package my.LigTv.Browser;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.webkit.WebView;
import android.app.AlertDialog;
public class LigTVBrowserActivity extends Activity {
/** Called when the activity is first created. */


WebView mWebView;
AlertDialog alertDialog;
protected boolean _active = true;
protected int _splashTime = 3000; // time to display the splash screen in ms
int progress = 0;


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



    final Activity activity = this;

    final ProgressDialog progressDialog = new ProgressDialog(activity);
    progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    progressDialog.setMessage("Please wait for the applet to load");

    progressDialog.show();
    progressDialog.setProgress(0);
    activity.setProgress(progress * 1000);

    progressDialog.incrementProgressBy(progress);

    if(progress == 100 && progressDialog.isShowing())
        progressDialog.dismiss(); 



    Thread splashTread = new Thread() {
        @Override
        public void run() {                 
            try {
                int waited = 0;
                while(_active && (waited < _splashTime)) {
                    sleep(100);

                    if(_active) {
                        waited += 100;                                                    
                        }
                }
            } catch(InterruptedException e) {
                // do nothing
            } finally {
                finish();
                startActivity(new Intent("my.LigTv.Browser.Starter"));
                stop();
            }
        }
    };
    splashTread.start();
}    

@Override
public boolean onTouchEvent(MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_DOWN) {
        _active = false;
    }
    return true;
}

 }
  • 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-03T01:06:10+00:00Added an answer on June 3, 2026 at 1:06 am

    Try calling finish() after starting the new activity. Also, why are you calling stop() on the thread? Once it has started the new activity, it will stop. This is an example I had already written, change as you wish:

                Runnable r1 = new Runnable(){
                    public void run(){
                        new Handler().postDelayed(new Runnable(){
                            @Override
                            public void run(){
                                startActivity(new Intent(Splash.this,Main.class));
                                overridePendingTransition(R.anim.fade_out, R.anim.fade_in);
                                finish();
    
                            }
                        }, waitTime);
                    }
                };
                runOnUiThread(r1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a classic physics-thread vs. graphics-thread problem: Say I'm running one thread for
I'm developing an Android application and I have a problem running a new thread
I'm a beginner with jdbc ... I have a problem running this code :
I have a problem with running jquery: <!DOCTYPE html> <html> <head> <meta http-equiv=Content-Type content=text/html;
I have a problem in running a new project which I downloaded from github.
I have a problem with Log4Net. Running C# .Net 2.0 Log4Net Ver. Not Sure.
I'm having problem when running my Windows Forms program. In the program, I have
I have an odd problem where Hibernate is running more queries than I've asked
I have the following problem: I have a form in site/banen (currently local running
We are running ColdFusion MX7. One problem we have is that we have a

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.