diff options
Diffstat (limited to 'main/src/cgeo/geocaching/connector/gc')
| -rw-r--r-- | main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java b/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java index 5327bea..c6d8dfe 100644 --- a/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java +++ b/main/src/cgeo/geocaching/connector/gc/RecaptchaHandler.java @@ -6,12 +6,14 @@ import cgeo.geocaching.network.Network; import cgeo.geocaching.utils.Log; import org.apache.commons.io.IOUtils; + import rx.Observable; import rx.android.observables.AndroidObservable; import rx.functions.Action1; import rx.functions.Func0; import rx.schedulers.Schedulers; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; @@ -71,11 +73,12 @@ public class RecaptchaHandler extends Handler { reloadButton.setEnabled(true); } + @SuppressLint("InflateParams") @Override - public void handleMessage(Message msg) { + public void handleMessage(final Message msg) { if (msg.what == SHOW_CAPTCHA) { final AlertDialog.Builder dlg = new AlertDialog.Builder(activity); - final View view = activity.getLayoutInflater().inflate(R.layout.recaptcha_dialog, null); + final View view = activity.getLayoutInflater().inflate(R.layout.recaptcha_dialog, null, false); final ImageView imageView = (ImageView) view.findViewById(R.id.image); @@ -83,7 +86,7 @@ public class RecaptchaHandler extends Handler { reloadButton.setEnabled(false); reloadButton.setOnClickListener(new View.OnClickListener() { @Override - public void onClick(View v) { + public void onClick(final View v) { recaptchaReceiver.fetchChallenge(); loadChallenge(imageView, reloadButton); } @@ -95,7 +98,7 @@ public class RecaptchaHandler extends Handler { dlg.setView(view); dlg.setNeutralButton(activity.getString(R.string.caches_recaptcha_continue), new DialogInterface.OnClickListener() { @Override - public void onClick(DialogInterface dialog, int id) { + public void onClick(final DialogInterface dialog, final int id) { final String text = ((EditText) view.findViewById(R.id.text)).getText().toString(); recaptchaReceiver.setText(text); dialog.cancel(); |
