如何使用CalendarContract类API级别8 [英] How to use CalendarContract class in API Level 8

查看:133
本文介绍了如何使用CalendarContract类API级别8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此次推出的安卓4.0, CalendarContract 类是介绍编写事件在设备日历。但如果我有使用API​​级别8创建我的应用程序,现在我想用这个 CalendarContract 类在我的项目进行使用API​​ 8级,因为在API级别8我有使用未公开的API在设备日历中编写事件,这code doen't为Android 4.工作,所以是有可能使用 CalendarContract 类在我的项目不改变SDK版本清单文件,因为如果我改变SDK版本为14,然后它允许我使用 CalendarContract 类,并通过它我可以解决这一问题对于Android 4。但是做所以我的应用程序没有启动的API 8 -13运行,并且我不想这样做,因为我的应用程序已出现在市场上。所以有解决这个问题的任何可能的方式。请用一个例子来解释我

After the launch of android 4, CalendarContract class is introduce to write event in device calendar. But if i have created my app using API level 8 and Now i want to use this CalendarContract class in my project done using API level 8, because in API level 8 i have use undocumented API to write event in device calendar and this code doen't work for android 4. So is it possible to use CalendarContract class in my project without changing the sdk version in manifest file, because if i change the sdk version to 14 then it allow me to use CalendarContract class and by which i can solve the issue for android 4. But on doing so my app not started running in api 8 -13, and which i dont want to do because my app is live on market. So is there any possible way to solve this problem. Please explain me with an example

推荐答案

找到一种方法以编程方式找到API级别...如果你能那么很可能,你可以使用适当的code的差异阿比水平......这可以帮助<一个href="http://stackoverflow.com/questions/2768806/how-to-obtain-the-android-api-level-of-a-device">How获得设备的Andr​​oid的API级别

Find a way to find the api level programmatically... if you can then probably you can use appropriate code for diff Api levels... this may help How to obtain the Android API Level of a device

这篇关于如何使用CalendarContract类API级别8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆