Moved the activity finish to the end of the method so that the database calls will be executed for sure before the activity finishes.
Changed the PreferencesHelper.js to take a db as a parameter so that it can be used for either the project db or the app db.  Made it so that the "switched_project" key value pair is store in the app dbs preference table instead of the project dbs preference table. That way it doesn't matter which project db is loaded while setting that k/v pair, old or new.
Hopefully fixed an error with the back button causing problems.