ArcGIS Runtime SDK for Android 100.1.x日期类型字段属性无法保存

在使用ArcGIS Runtime SDK for Android 100.1.x版本时遇到一个问题,即日期类型字段无法保存,导致运行时异常。错误信息显示对Date类型的转换未实现。解决方法是将日期类型的数据转换为Calendar对象进行处理,从而成功保存。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 报错代码如下

Feature addedFeature = mFeatureLayerTrack.getFeatureTable().createFeature(); addedFeature.setGeometry(polyline); //获取要素属性结构
Map<String, Object> attrs = addedFeature.getAttributes(); 
attrs.put("RecordTime", new Date());//记录当前时间:在这里出错

报错信息如下:

03-26 15:51:44.983 27424-27424/com..E/AndroidRuntime: FATAL EXCEPTION: main
                                                                    Process: com.., PID: 27424
                                                                    java.lang.UnsupportedOperationException: Conversion to CoreElement not implemented: class java.util.Date
                                                                        at com.esri.arcgisruntime.internal.n.g.a(SourceFile:528)
                                                                        at com.esri.arcgisruntime.internal.n.k$b.a(SourceFile:452)
                                                                        at com.esri.arcgisruntime.internal.n.k$b.add(SourceFile:399)
                                                                        at com.esri.arcgisruntime.internal.n.g.a(SourceFile:762)
                                                                        at com.esri.arcgisruntime.data.FeatureTable.createFeature(SourceFile:535)
                                                                        at com.esri.arcgisruntime.internal.g.b$1.run(SourceFile:57)
                                       

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值