diff --git a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java index 8ed4a0a8..3e8519e3 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java +++ b/app/src/main/java/com/m2049r/xmrwallet/LoginActivity.java @@ -593,7 +593,7 @@ public class LoginActivity extends AppCompatActivity // If request is cancelled, the result arrays are empty. if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - startLoginFragment(); + startLoginFragment = true; } else { String msg = getString(R.string.message_strorage_not_permitted); Log.e(TAG, msg); @@ -605,6 +605,17 @@ public class LoginActivity extends AppCompatActivity } } + private boolean startLoginFragment = false; + + @Override + protected void onResumeFragments() { + super.onResumeFragments(); + if (startLoginFragment) { + startLoginFragment(); + startLoginFragment = false; + } + } + void startLoginFragment() { Fragment fragment = new LoginFragment(); getSupportFragmentManager().beginTransaction() diff --git a/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java b/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java index af2985ca..2ebed53c 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java +++ b/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java @@ -612,6 +612,16 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment. getWallet().disposePendingTransaction(); } + private boolean startScanFragment = false; + + @Override + protected void onResumeFragments() { + super.onResumeFragments(); + if (startScanFragment) { + startScanFragment(); + startScanFragment = false; + } + } private void startScanFragment() { Bundle extras = new Bundle(); @@ -703,7 +713,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment. // If request is cancelled, the result arrays are empty. if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { - startScanFragment(); + startScanFragment = true; } else { String msg = getString(R.string.message_camera_not_permitted); Log.e(TAG, msg);