版本为2.3的本机电子邮件应用程序在版本4.0中运行,它将显示以下异常:

W/dalvikvm( 1308): VFY: unable to resolve static field 31 (CONTENT_URI) in Landroid/provider/Calendar$Calendars;
D/dalvikvm( 1308): VFY: replacing opcode 0x62 at 0x0014
E/AccountManager( 1308): Listener was not previously added
W/dalvikvm( 1308): threadid=13: thread exiting with uncaught exception (group=0x40c391f8)
V/EmailProvider( 1308): EmailProvider.query: uri=content://com.screenshare.email.provider/account/2, match is 2
E/AndroidRuntime( 1308): FATAL EXCEPTION: SyncManager
E/AndroidRuntime( 1308): java.lang.NoClassDefFoundError: android.provider.Calendar$Calendars
E/AndroidRuntime( 1308):        at com.screenshare.exchange.SyncManager$CalendarObserver.<init>(SyncManager.java:704)
E/AndroidRuntime( 1308):        at com.screenshare.exchange.SyncManager.registerCalendarObserver(SyncManager.java:655)
E/AndroidRuntime( 1308):        at com.screenshare.exchange.SyncManager.checkMailboxes(SyncManager.java:2138)
E/AndroidRuntime( 1308):        at com.screenshare.exchange.SyncManager.run(SyncManager.java:1949)
E/AndroidRuntime( 1308):        at java.lang.Thread.run(Thread.java:856)


Calendar API是否已从4.0中删除?如何使2.3 Email应用程序在4.0中成功运行?还是不能解决?

最佳答案

我知道原因:日历提供程序已在4.0中更改。在2.3中,日历提供程序为android.provider.Calendar,在4.0中,日历提供程序为android.provider.CalendarContract。因此,如果未修改源代码,它将无法在4.0中成功运行。

10-07 15:53