@Override
  protected void onResume() {
    super.onResume();

    // If the application was shutdown make sure to clear the password field, if it
    // was saved in the instance state
    if (App.isShutdown()) {
      TextView password = (TextView) findViewById(R.id.password);
      password.setText("");
    }

    // Clear the shutdown flag
    App.clearShutdown();
  }
  private void loadDatabase(String pass, String keyfile) {
    if (pass.length() == 0 && keyfile.length() == 0) {
      errorMessage(R.string.error_nopass);
      return;
    }

    String fileName = getEditText(R.id.filename);

    // Clear before we load
    Database db = App.getDB();
    db.clear();

    // Clear the shutdown flag
    App.clearShutdown();

    Handler handler = new Handler();
    LoadDB task =
        new LoadDB(db, PasswordActivity.this, fileName, pass, keyfile, new AfterLoad(handler));
    ProgressTask pt = new ProgressTask(PasswordActivity.this, task, R.string.loading_database);
    pt.run();
  }