Restores selected note when rotating tablet from portrait to landscape.

Also fixed #1497