S_S
S_S

Reputation: 1402

Android Camera NoSuchMethodError on Exposure Lock

I am getting a NoSuchMethodError on Camera.Parameters.isAutoExposureLockSupported()

How can this be avoided?

I am using:

android:minSdkVersion="8"
android:targetSdkVersion="17"

running application on HTC Wildfire S with Android 2.3.5

Upvotes: 0

Views: 139

Answers (1)

Ken Wolf
Ken Wolf

Reputation: 23269

isAutoExposureLockSupported() was added in API level 14.

You will need minSDKVersion to be 14 if you want to use this. Your HTC Wildfire S with Android 2.3.5 has no idea about this method.

To fix, you can raise the minimum required SDK version in your manifest, or don't use it in lower versions by doing a version check at runtime.

if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    // call isAutoExposureLockSupported() and do whatever you need
}

Upvotes: 1

Related Questions