But this code makes an assumption that the value of newVersion is always the newest version of the database (the value supplied to the SQLiteOpenHelper constructor). Is this alwyas true?
Yes.
This can be verified by reading the source where onUpgrade()
is called with newVersion
argument being the same you passed in as the argument to SQLiteOpenHelper
constructor.