문제

I'm trying to use AlarmClock in my app, but I'm using android 2.2 and have a error message saying that Field requires API level 9 (current min is 8). What can I do?

도움이 되었습니까?

해결책

Either:

  1. Increase your android:minSdkVersion to 9, or

  2. Don't use AlarmClock at all, or

  3. Check Build.VERSION.SDK_INT to see if you are on Build.VERSION_CODES.GINGERBREAD or higher, and only use AlarmClock on devices where this is true (then add the TargetApi(Build.VERSION_CODES.GINGERBREAD) annotation to the method where you are using AlarmClock to get rid of the error message)

AlarmClock itself was only added in API Level 9, and therefore cannot be used on API Level 8 or below.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top