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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:03:52+00:00 2026-06-06T09:03:52+00:00

Is it possible in Java (Android) to implement a customized version of a Thread

  • 0

Is it possible in Java (Android) to implement a customized version of a Thread which carries its own States?

What I mean is:
While ThreadA is in Running state, it still can be polled by ThreadB that asks for its state

e.g.
ThreadA.getState();

It is possible to modify the states values to some custom ones? So as to implement a sort of basic communication system between those two threads?

Thanks.

  • 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-06T09:03:54+00:00Added an answer on June 6, 2026 at 9:03 am

    Yes that is possible. I used this a lot in my previous projects, all what you need is to extend the Thread class.

    public class StateThread extends Thread{
       String state = "ThreadState";
       public synchronized void setState(String newState){
          state = newState;
       }
       public synchronized String getState(){
          return state;
       }
       @override
       public void run(){
          // Do stuff and update state...
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to implement the model–view–controller pattern in Java for Android? Or is
Possible Duplicate: R.java Missing in Android Project in NetBeans In Android I am Getting
I want to know if it is possible to write java code in android
Possible Duplicate: Developing for Android in Eclipse: R.java not generating what to do if
I have web services written using java which interacts with the android application only
Lately I wrote an application in java (for android) which used reflection to invoke
Possible Duplicate: Java Synchronization I'm reading the book Beginning Android Games . It uses
More specifically, is it possible for an non-android Java application to use android's speech
Is it possible to do method swizzling in android using java? i would like
Is it possible to run a legacy Java application on Android? The application has

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.