是否可以在Firestore中保存CharSequence? [英] Is it possible to save a CharSequence in Firestore?

查看:62
本文介绍了是否可以在Firestore中保存CharSequence?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将 CharSequence 变量保存到 Firebase 中?

Is possible to save a CharSequence variable into Firebase?

已检出:支持的数据类型,但字符序列不存在...

Checked out: Supported Data Types, but charsequence is not there...

我遇到了与此相关的可序列化问题,尝试过:护卫规则,公共属性,实现可序列化等;但是我无法将字符序列保存到 Firebase 中.

I'm getting serializable problems related to this, tried: pro-guard rules, public attributes, implements serializable, etc; but I'm not able to save charsequence into Firebase.

有人能帮助我吗?

PS:它必须是 字符序列 ,而不是字符串!

推荐答案

您可以将CharSequence保存为Firestore,方法是使用其

You can save a CharSequence to Firestore by converting it to a String with its toString() method. If you read the string back from Firestore, it will be a String object, which implements CharSequence as well. You will not be able to use automatic serialization with a CharSequence interface. The SDK won't know which implementation of CharSequence to create for you when you read the data back out.

这篇关于是否可以在Firestore中保存CharSequence?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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