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 {
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
if(databaseConfig.getEncryptionKey() == null) {
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();
}
if(databaseConfig.getEncryptionKey() != null) startAndBindService();
}
@Override
......@@ -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
public void 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