[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] Fixed compiler warnings.



commit f000d58b146c12d6d3d04bacf9842aa7732b4d0f
Author: Benjamin Erhart <berhart@xxxxxxxxxxxxxxxxxxx>
Date:   Tue Dec 15 14:00:44 2020 +0100

    Fixed compiler warnings.
---
 .../android/ui/onboarding/MoatActivity.java        | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
index 619a371b..f1bce82a 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/MoatActivity.java
@@ -190,9 +190,8 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
 
         mQueue = Volley.newRequestQueue(MoatActivity.this, phs);
 
-            if (mCaptcha == null) {
-                new Handler().postDelayed(this::fetchCaptcha, 1000);
-            }
+        if (mCaptcha == null) {
+            new Handler(Looper.getMainLooper()).postDelayed(this::fetchCaptcha, 1000);
         }
     }
 
@@ -205,15 +204,16 @@ public class MoatActivity extends AppCompatActivity implements View.OnClickListe
 
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
-        switch (item.getItemId()) {
-            case R.id.menu_refresh:
-                mEtSolution.setText("");
-                fetchCaptcha();
-                return true;
-
-            case android.R.id.home:
-                finish();
-                return true;
+        int id = item.getItemId();
+
+        if (id == R.id.menu_refresh) {
+            mEtSolution.setText("");
+            fetchCaptcha();
+            return true;
+        }
+        else if (id == android.R.id.home) {
+            finish();
+            return true;
         }
 
         return super.onOptionsItemSelected(item);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits