Fix to this commmit: Add listener to the class PatternRequestActivity to reuse the on success or fail password event

This commit is contained in:
dtvv 2018-10-25 02:16:38 -05:00
parent ba96d999ff
commit 753a4a5943

View file

@ -42,7 +42,7 @@ public class PatternRequestActivity extends AppCompatActivity {
/* /*
* External listener for success or fail * External listener for success or fail
* */ * */
private OnResponse onResponse; private static OnResponse onResponse;
/* /*
* Contains the bad tries * Contains the bad tries
@ -108,6 +108,7 @@ public class PatternRequestActivity extends AppCompatActivity {
if(onResponse != null){ if(onResponse != null){
onResponse.onSuccess(); onResponse.onSuccess();
onResponse = null;
} }
} else { } else {
@ -115,6 +116,7 @@ public class PatternRequestActivity extends AppCompatActivity {
if(onResponse != null){ if(onResponse != null){
onResponse.onSuccess(); onResponse.onSuccess();
onResponse = null;
} }
} }
} else { } else {
@ -122,6 +124,7 @@ public class PatternRequestActivity extends AppCompatActivity {
if(onResponse != null){ if(onResponse != null){
onResponse.onFailed(); onResponse.onFailed();
onResponse = null;
} }
} }
} }
@ -140,8 +143,8 @@ public class PatternRequestActivity extends AppCompatActivity {
}); });
} }
public void setOnResponse(OnResponse onResponse) { public static void setOnResponse(OnResponse onResponse) {
this.onResponse = onResponse; onResponse = onResponse;
} }
private void incorrect(){ private void incorrect(){