我正在尝试为黑莓手机编写应用程序,而且我正在使用持久性存储,但是当我重新启动设备时,数据丢失了。任何人都知道为什么会发生这种情况?
在此先感谢大家!黑莓持久性商店 - 手持重新启动后没有数据保存
public static void add(Subscription s) throws IOException {
Vector subscriptions = SubscriptionsController.getSubscriptions();
if(subscriptions == null) subscriptions = new Vector();
subscriptions.addElement(s);
synchronized(SubscriptionsController.persistedSubscriptions) {
SubscriptionsController.persistedSubscriptions.setContents(subscriptions);
SubscriptionsController.persistedSubscriptions.commit();
}
}
请发布您正在使用的代码 – seand 2011-04-18 07:44:46
@seand,我上面贴的代码确实实际存储了。 – Olsi 2011-04-18 07:48:04