mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Don't create duplicate PasswordActivity when screen is rotated. Bug #43
This commit is contained in:
@@ -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 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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();
|
||||||
|
|||||||
Reference in New Issue
Block a user