mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Solve crash when keyfile is selected
This commit is contained in:
@@ -142,15 +142,17 @@ public class PasswordActivity extends LockingActivity
|
|||||||
Intent data) {
|
Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
|
if (keyFileHelper != null) {
|
||||||
keyFileHelper.onActivityResultCallback(requestCode, resultCode, data,
|
keyFileHelper.onActivityResultCallback(requestCode, resultCode, data,
|
||||||
new KeyFileHelper.KeyFileCallback() {
|
new KeyFileHelper.KeyFileCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onKeyFileResultCallback(Uri uri) {
|
public void onKeyFileResultCallback(Uri uri) {
|
||||||
if(uri != null) {
|
if (uri != null) {
|
||||||
keyFileView.setText(uri.toString());
|
keyFileView.setText(uri.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
switch (requestCode) {
|
switch (requestCode) {
|
||||||
case KeePass.EXIT_NORMAL:
|
case KeePass.EXIT_NORMAL:
|
||||||
@@ -197,6 +199,10 @@ public class PasswordActivity extends LockingActivity
|
|||||||
checkboxKeyfileView = (CompoundButton) findViewById(R.id.keyfile_checkox);
|
checkboxKeyfileView = (CompoundButton) findViewById(R.id.keyfile_checkox);
|
||||||
checkboxDefaultDatabaseView = (CompoundButton) findViewById(R.id.default_database);
|
checkboxDefaultDatabaseView = (CompoundButton) findViewById(R.id.default_database);
|
||||||
|
|
||||||
|
View browseView = findViewById(R.id.browse_button);
|
||||||
|
keyFileHelper = new KeyFileHelper(PasswordActivity.this);
|
||||||
|
browseView.setOnClickListener(keyFileHelper.getOpenFileOnClickViewListener());
|
||||||
|
|
||||||
passwordView.addTextChangedListener(new TextWatcher() {
|
passwordView.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}
|
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {}
|
||||||
@@ -257,10 +263,6 @@ public class PasswordActivity extends LockingActivity
|
|||||||
|
|
||||||
checkboxDefaultDatabaseView.setOnCheckedChangeListener(new DefaultCheckChange());
|
checkboxDefaultDatabaseView.setOnCheckedChangeListener(new DefaultCheckChange());
|
||||||
|
|
||||||
View browseView = findViewById(R.id.browse_button);
|
|
||||||
keyFileHelper = new KeyFileHelper(PasswordActivity.this);
|
|
||||||
browseView.setOnClickListener(keyFileHelper.getOpenFileOnClickViewListener());
|
|
||||||
|
|
||||||
retrieveSettings();
|
retrieveSettings();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
|||||||
Reference in New Issue
Block a user