我正在学习如何使用SQLite Databses,我有一个如何使用简单数据的要点,例如我知道我可以将数据类型TEXT的名称和电子邮件存储到表中 . 现在,我想将同样的东西应用于更复杂的对象,存储我的Alarm对象 . 我的警报看起来像

public class Alarm {

public int st;

public String name;

public String time;

public String date;

public long mili; ///calender time

public Intent intent;

public PendingIntent pendingIntent;

public AlarmManager manager;

public Alarm(String name, String time, String date, int st, long mili, Intent intent, PendingIntent pendingIntent, AlarmManager manager){

this.name = name;

this.time = time;

this.date = date;

this.st = st;

this.mili = mili;

this.intent = intent;

this.pendingIntent = pendingIntent;

this.manager = manager;

}

}

我知道我可以使用诸如INTEGER和TEXT之类的数据类型来存储我的字符串和整数,但是有没有办法存储诸如意图,待定意图和管理器之类的东西 . 我有一个这些对象的列表,我在不同的类中使用,所以我需要能够访问每个警报对象意图,待定意图和管理器,以便我可以重置和取消警报,因此我发现它很容易存储对象中的数据 . 但是我不确定这实际上可以保存在SQL表中 . 有人会与我分享一些提示吗?

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐