Added instance save and restore to main activity.

Fixed the null exception error when rotating display.