diff options
Diffstat (limited to 'src/cgeo/geocaching/cgSearchThread.java')
| -rw-r--r-- | src/cgeo/geocaching/cgSearchThread.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cgeo/geocaching/cgSearchThread.java b/src/cgeo/geocaching/cgSearchThread.java new file mode 100644 index 0000000..0cd99ce --- /dev/null +++ b/src/cgeo/geocaching/cgSearchThread.java @@ -0,0 +1,46 @@ +package cgeo.geocaching; + +import android.os.Handler; +import android.util.Log; + +public class cgSearchThread extends Thread { + private Handler recaptchaHandler = null; + private String recaptchaChallenge = null; + private String recaptchaText = null; + + public void setRecaptchaHandler(Handler recaptchaHandlerIn) { + recaptchaHandler = recaptchaHandlerIn; + } + + public void notifyNeed() { + if (recaptchaHandler != null) { + recaptchaHandler.sendEmptyMessage(1); + } + } + + public synchronized void waitForUser() { + try { + wait(); + } catch (InterruptedException e) { + Log.w(cgSettings.tag, "searchThread is not waiting for user..."); + } + } + + public void setChallenge(String challenge) { + recaptchaChallenge = challenge; + } + + public String getChallenge() { + return recaptchaChallenge; + } + + public synchronized void setText(String text) { + recaptchaText = text; + + notify(); + } + + public String getText() { + return recaptchaText; + } +} |
