Removed ExitChangeDb result code (no longer required)

Added "!IsFinisihing"
This commit is contained in:
Philipp Crocoll 2013-08-10 20:09:13 +02:00
parent eaa426db33
commit 96a4831758
2 changed files with 1 additions and 6 deletions

View File

@ -39,7 +39,6 @@ namespace keepass2android
public const Result ExitRefresh = Result.FirstUser+2; public const Result ExitRefresh = Result.FirstUser+2;
public const Result ExitRefreshTitle = Result.FirstUser+3; public const Result ExitRefreshTitle = Result.FirstUser+3;
public const Result ExitCloseAfterTaskComplete = Result.FirstUser+4; public const Result ExitCloseAfterTaskComplete = Result.FirstUser+4;
public const Result ExitChangeDb = Result.FirstUser+5; // NOTE: Nothing is currently using this, but in the future a "Change Database" menu option might.
public const Result ExitReloadDb = Result.FirstUser+6; public const Result ExitReloadDb = Result.FirstUser+6;
AppTask _appTask; AppTask _appTask;

View File

@ -147,10 +147,6 @@ namespace keepass2android
case KeePass.ExitLock: case KeePass.ExitLock:
// The database has already been locked, and the quick unlock screen will be shown if appropriate // The database has already been locked, and the quick unlock screen will be shown if appropriate
break; break;
case KeePass.ExitChangeDb:
App.Kp2a.LockDatabase(false);
Finish();
break;
case KeePass.ExitCloseAfterTaskComplete: case KeePass.ExitCloseAfterTaskComplete:
// Do not lock the database // Do not lock the database
SetResult(KeePass.ExitCloseAfterTaskComplete); SetResult(KeePass.ExitCloseAfterTaskComplete);
@ -415,7 +411,7 @@ namespace keepass2android
// OnResume is run every time the activity comes to the foreground. This code should only run when the activity is started (OnStart), but must // OnResume is run every time the activity comes to the foreground. This code should only run when the activity is started (OnStart), but must
// be run in OnResume rather than OnStart so that it always occurrs after OnActivityResult (when re-creating a killed activity, OnStart occurs before OnActivityResult) // be run in OnResume rather than OnStart so that it always occurrs after OnActivityResult (when re-creating a killed activity, OnStart occurs before OnActivityResult)
if (_started) if (_started && !IsFinishing) //use !IsFinishing to make sure we're not starting another activity when we're already finishing (e.g. due to TaskComplete in OnActivityResult)
{ {
_started = false; _started = false;
if (App.Kp2a.DatabaseIsUnlocked) if (App.Kp2a.DatabaseIsUnlocked)