Jump to content

Recommended Posts

Posted (edited)

Hey guys, I have made two classes I want to use to execute a commands. One of the classes (NickScan) is my command class and the other (NickScanRunnable) is my runnable class. I have a HTTP GET request running in my runnable class which is ran in my command class on 'processCommand()'. In my runnable class I edit a public variable to the String I want and then I use the Thread.join() method to connect to the thread and after retrieve my public variable which I then output. The problem is Thread.join() suspends my UI thread too. I was wondering if there was any other way to do this? I will attach code below.

 

NickScan class:

 
 
 
 
  Reveal hidden contents

 

NickScanRunnable class:

 
 
 
 
  Reveal hidden contents

 

Edited by Mine215
Make it look cleaner
Posted (edited)

It's only normal for the main thread to block. I mean you join the main thread, it will be blocked until the other thread finish.

Edited by Zen3515

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.