存储和检索共用preference一个类对象 [英] store and retrieve a class object in shared preference

查看:113
本文介绍了存储和检索共用preference一个类对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android的我需要知道,如果我们可以存储一类的共享preference的对象,并检索对象latter.If,可以怎么做吧。如果它是不可能有什么其他的可能性这样做吧。我知道序列化是一种选择,但我在寻找机会使用共享preference。

In android i need to know if we can store an object of a class in shared preference and retrieve the object latter.If it is possible how to do it.If it is not possible what are the other possibilities of doing it.I know serialization is one option but i am looking for possibilities using shared preference.

任何帮助是AP preciated。

Any help is appreciated.

感谢。

推荐答案

不可能的。

您只能存储在共享prefences简单值<一href="http://developer.android.com/reference/android/content/Shared$p$pferences.Editor.html">Share$p$pferences.Editor

You can only store, simple values in SharedPrefences SharePreferences.Editor

什么特别关于类你需要保存?

What particularly about the class do you need to save?

这篇关于存储和检索共用preference一个类对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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