Fix possible crash when switching language after activity closed.

Also fix checkstyle item.

Change-Id: I0c5513059b419a5a140454b96eeb0e1f428597b0