Fix exception on rotation.

Change-Id: I6cc653db3397074fb1cd9aa12b06511ce2cc3c9d
JIRA:CYAN-731
Merge "Fix exception on rotation." into cm-10.1
Merge branch 'cyanogenmod' into cm-10.1

Signed-off-by: Humberto Borba <humberos@gmail.com>