From 753a4a5943a8e91417f26799e92f88e0d706c6fc Mon Sep 17 00:00:00 2001 From: dtvv Date: Thu, 25 Oct 2018 02:16:38 -0500 Subject: [PATCH] Fix to this commmit: Add listener to the class PatternRequestActivity to reuse the on success or fail password event --- .../crystalwallet/activities/PatternRequestActivity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/PatternRequestActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/PatternRequestActivity.java index 41b7b9a..09e4bb8 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/PatternRequestActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/PatternRequestActivity.java @@ -42,7 +42,7 @@ public class PatternRequestActivity extends AppCompatActivity { /* * External listener for success or fail * */ - private OnResponse onResponse; + private static OnResponse onResponse; /* * Contains the bad tries @@ -108,6 +108,7 @@ public class PatternRequestActivity extends AppCompatActivity { if(onResponse != null){ onResponse.onSuccess(); + onResponse = null; } } else { @@ -115,6 +116,7 @@ public class PatternRequestActivity extends AppCompatActivity { if(onResponse != null){ onResponse.onSuccess(); + onResponse = null; } } } else { @@ -122,6 +124,7 @@ public class PatternRequestActivity extends AppCompatActivity { if(onResponse != null){ onResponse.onFailed(); + onResponse = null; } } } @@ -140,8 +143,8 @@ public class PatternRequestActivity extends AppCompatActivity { }); } - public void setOnResponse(OnResponse onResponse) { - this.onResponse = onResponse; + public static void setOnResponse(OnResponse onResponse) { + onResponse = onResponse; } private void incorrect(){