mirror of https://github.com/m2049r/xmrwallet.git
request and respond to permissions marshmallow style
This commit is contained in:
parent
5b3e92e91a
commit
0013caa05f
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue