- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试为我的 Activity 创建 ExtendedProperties 并收到以下错误:
02-06 09:43:04.484: E/AndroidRuntime(9530): FATAL EXCEPTION: IntentService[AsyncQueryServiceHelper]
02-06 09:43:04.484: E/AndroidRuntime(9530): java.lang.IllegalArgumentException: Only sync adapters may write using content://com.android.calendar/extendedproperties
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.database.DatabaseUtils.readExceptionWithOperationApplicationExceptionFromParcel(DatabaseUtils.java:160)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:484)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:227)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.content.ContentResolver.applyBatch(ContentResolver.java:954)
02-06 09:43:04.484: E/AndroidRuntime(9530): at com.android.calendar.iselection.AsyncQueryServiceHelper.onHandleIntent(AsyncQueryServiceHelper.java:327)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.os.Handler.dispatchMessage(Handler.java:99)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.os.Looper.loop(Looper.java:176)
02-06 09:43:04.484: E/AndroidRuntime(9530): at android.os.HandlerThread.run(HandlerThread.java:61)
我的代码如下:
ContentValues customerContentValues = new ContentValues();
Uri uriExtendedProperties = Uri.parse("content://com.android.calendar/extendedproperties");
customerContentValues.put(Events._ID,model.mId);
customerContentValues.put("ClientIdname", model.mCustomerName);
customerContentValues.put("RdvType", model.mEventType);
customerContentValues.put("RdvEmplacement", model.mEmplacement);
customerContentValues.put("RdvAdresse", model.mAddresse);
ops.add(ContentProviderOperation.newInsert(uriExtendedProperties).withValues(customerContentValues).build());
有什么我错过的吗?需要一些插入..提前致谢
有没有人可以告诉我更多关于同步适配器的信息,因为我真的很困惑......任何建议都会受到欢迎。
最佳答案
ExtendedProperties
与普通的 Evnets
和 Attendees
表略有不同。
为了写入它,您需要修改您正在使用的 uri 并添加“caller_is_syncadapter”、“account_name' 和 'account_type' 参数。
这是一个例子:
Uri extendedPropUri = ExtendedProperties.CONTENT_URI;
extendedPropUri = extendedPropUri.buildUpon()
.appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER,"true")
.appendQueryParameter(Calendars.ACCOUNT_NAME, this.accountName)
.appendQueryParameter(Calendars.ACCOUNT_TYPE, this.accountType).build();
然后插入看起来像:
ContentValues extraDataValues = new ContentValues();
extraDataValues.put(ExtendedProperties.EVENT_ID, eventId);
extraDataValues.put(ExtendedProperties.NAME, key);
extraDataValues.put(ExtendedProperties.VALUE, value);
context.getContentResolver().insert(extendedPropUri, extraDataValues);
关于java - 尝试为 android-calendar 实现 ExtendedProperties 时出现 IllegalArgumentException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28362241/
总的来说,我对 EWS 和 Exchange 很陌生,所以不确定什么是最好的方法。 背景 我正在尝试设置有关房间的配置信息。我希望 EWS API 为我提供了一个 Room 对象,我可以在该对象上添加
C# DataTable 有一个 PropertyCollection ExtendedProperties。该表中的 DataColumn 也有一个 ExtendedProperties 为什么 D
Google 日历事件具有可用于将名称/值对附加到事件的扩展属性。 我们正在实现一个协作日历应用程序,该应用程序使用这些扩展属性将额外信息附加到事件中。按照 Google 的建议,我们使用 Andro
我们正在从 Remoting 迁移到 WCF 一个非常大的应用程序,它大量使用数据集。我们使用数据集表的扩展属性来存储包含我们在客户端需要的特殊信息的对象图。 在我们的 Remoting 实现中,我们
我有一个Exchange Server,其中包含带有自定义字段的项目(例如,具有自定义ExtendedProperty值的“联系人”和“事件”)。我正在寻找一种使用Exchange Web服务(EWS
我正在使用 SyncAdapter 在 Android 应用日历上存储额外数据,例如 ExtendedProperties,在本地存储 ExtendedProperties 时效果很好,我的日历应用正
我正在尝试为我的 Activity 创建 ExtendedProperties 并收到以下错误: 02-06 09:43:04.484: E/AndroidRuntime(9530): FATAL E
我想将 Tiles 3 与 Strut 2 一起使用,所以我正在使用 struts2-tiles3-plugin。我在 web.xml 中定义了监听器,在 struts.xml 中定义了结果类型。当我
我是一名优秀的程序员,十分优秀!