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:
Increase your android:minSdkVersion
to 9, or
Don't use AlarmClock
at all, or
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.