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

  • Home
  • SEARCH
  • 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 8659897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:07:07+00:00 2026-06-12T16:07:07+00:00

looking at several android examples i see a trend where threads are paused using

  • 0

looking at several android examples i see a trend where threads are paused using join() method:

EDIT: please assume that the 2 threads are properly defined. edited the calls to join()

public class MainUI extends Activity{
   private GraphicsViewThread g;
   private BackendDataViewThread b;

   void onCreate(){
      g = new GraphicsViewThread();
      g.start();
      b = new BackendDataViewThread();
      b.start();
   }
   .
   .
   .
   void pauseGame(){
      try {
        g.join();
      }catch (InterruptedException e){
         e.printStackTrace();
      }
      try {
        b.join();
      }catch (InterruptedException e){
         e.printStackTrace();
      }
      GraphicsViewThread = null;
      BackendDataViewThread  = null;
   }
}
  1. which thread does GraphicsViewThread and BackendDataViewThread join to?
  2. what is the need for using join()? can i not set the references immediately to null?
  • 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-12T16:07:08+00:00Added an answer on June 12, 2026 at 4:07 pm

    I suspect your code doesn’t compile, but regardless – I’ll answer.
    This is not just about Android, but plain Java.
    Using “join” ensures that you code will wait for the thread to end.
    Isn’t this exactly what you want?
    In addition, don’t set references of thread to null.
    You cannot guarantee exactly when a thread ends, so it will be bad practice to set the thread object to null, prior to its ending.

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

Sidebar

Related Questions

I googled several times but couldn't find what I was looking for. Android assigns
I am looking for a way to create figure that contains several subplots which
Several answers mention to use GradientDrawable.setDither(true) to draw smooth gradients in Android. That has
I am looking at several XSD files that use msdata:Ordinal for the elements within
I'm looking to change several images onclick using JQuery instead of normal JavaScript and
I am looking at locking down several Android Tablets (Samsung Galaxy tab) to allow
Looking at several posts, I get a feel that many of the questions arise
After looking at several questions/answers here, I'm not seeing what I think I need.
I have tried looking though several of the already asked question about this topic
I'm looking into providing several methods of visualizing a large volume of data. This

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.