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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:22:12+00:00 2026-06-10T17:22:12+00:00

I have run into a problem that may interest many (beginners). Let me show

  • 0

I have run into a problem that may interest many (beginners). Let me show you the code:

startButton.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            startButton.setVisibility(View.GONE);
            if (!started) {
                started = true;
                timer.start();
                information.append("Start 1\n");
                tester1.start();
                if (cores >= 2) {
                    information.append("Start 2\n");
                    tester2.start();
                }
                if (cores >= 3) {
                    information.append("Start 3\n");
                    tester3.start();
                }
                if (cores >= 4) {
                    information.append("Start 4\n");
                    tester4.start();
                }

            }
        }
    });

timer, and all testers are threads previously declared.
information is a TextView.

The problem is that when I run the app, the textview changes after the threads finish, even if the threads take 10 seconds to finish. This does happen on the emulator (android 2.3) and on a real (android 4.0) device. The odd thing is, the threads do start at roughly the same time.

  • 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-10T17:22:13+00:00Added an answer on June 10, 2026 at 5:22 pm

    You must update any UI components from main thread.

    For example

    runOnUiThread(new Runnable() {
        public void run() {
            someTextView.setText(someResultVariable);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just installed VS2008 and have run into a problem that I'm sure can
I frequently run into the problem that I have to preserve state between several
I have run into a little problem. I am connecting to a webservice that
I've run into an rather irritating problem in java. I have a program that
I've run into a rather strange problem. I have a div that is rotatable
I have run into a problem with Eclipse Indigo, attempting to start up my
I have run into a problem trying to modify a form I myself have
I have run into a problem w/ my model for databinding in WPF. I
I have run into a problem... I'm trying to use QTKit in an application
I have run into this problem a few times and I'm not happy with

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.