Updated MainActivity in order to preserve the fragment in landscape and portrait mode.