move it to a method and add @TargetApi(19)
PS: SurfaceTexture needs API19 and setPreviewTexture() API11