From e569986864c0a032acaab4edb0a814017523ff4d Mon Sep 17 00:00:00 2001 From: Javier Varona Date: Thu, 6 Sep 2018 21:08:59 -0400 Subject: [PATCH] - Fixed app asking for password when the back button is pressed after selecting import account by backup --- .../crystalwallet/fragments/ImportAccountOptionsFragment.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java index f4ae3da..1e7ef17 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java @@ -28,6 +28,8 @@ import cy.agorise.crystalwallet.requestmanagers.FileServiceRequests; import cy.agorise.crystalwallet.requestmanagers.ImportBackupRequest; import cy.agorise.crystalwallet.util.UriTranslator; +import static android.app.Activity.RESULT_OK; + /** * Created by xd on 1/25/18. * Shows a dialog where the user can select how to import his/her existing account @@ -99,7 +101,7 @@ public class ImportAccountOptionsFragment extends DialogFragment { public void onActivityResult(int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); - if (requestCode == FILE_CONTENT_REQUEST_CODE){ + if ((requestCode == FILE_CONTENT_REQUEST_CODE) && (resultCode == RESULT_OK)){ LayoutInflater inflater = getActivity().getLayoutInflater(); View passwordDialogView = inflater.inflate(R.layout.dialog_password_input, null); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getContext());