Minor: You could probably make this autofocus = true given you are looking for it not being null below.