Skip to content
Snippets Groups Projects
Commit d21ced30 authored by akwizgran's avatar akwizgran
Browse files

Don't create duplicate PasswordActivity when screen is rotated. Bug #43

parent e479bf0a
No related branches found
No related tags found
No related merge requests found
...@@ -33,14 +33,7 @@ public class BriarActivity extends RoboFragmentActivity { ...@@ -33,14 +33,7 @@ public class BriarActivity extends RoboFragmentActivity {
@Override @Override
public void onCreate(Bundle state) { public void onCreate(Bundle state) {
super.onCreate(state); super.onCreate(state);
if(databaseConfig.getEncryptionKey() == null) { if(databaseConfig.getEncryptionKey() != null) startAndBindService();
if(LOG.isLoggable(INFO)) LOG.info("No password");
Intent i = new Intent(this, PasswordActivity.class);
i.setFlags(FLAG_ACTIVITY_NO_ANIMATION | FLAG_ACTIVITY_SINGLE_TOP);
startActivityForResult(i, REQUEST_PASSWORD);
} else {
startAndBindService();
}
} }
@Override @Override
...@@ -52,6 +45,16 @@ public class BriarActivity extends RoboFragmentActivity { ...@@ -52,6 +45,16 @@ public class BriarActivity extends RoboFragmentActivity {
} }
} }
@Override
public void onResume() {
super.onResume();
if(databaseConfig.getEncryptionKey() == null && !isFinishing()) {
Intent i = new Intent(this, PasswordActivity.class);
i.setFlags(FLAG_ACTIVITY_NO_ANIMATION | FLAG_ACTIVITY_SINGLE_TOP);
startActivityForResult(i, REQUEST_PASSWORD);
}
}
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment