First, you need this permission in your AndroidManifest.xml
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
your IDE may give you error: (but you still can compile and generate apk)
To fix this , you need:
you need add this:
i think the documentation was just short hand for the Calendar stuff. I don't think it actually works with just 2014; however I can be wrong.