我正在尝试为黑莓编写一个应用程序并且我正在使用持久存储,但是当我重新启动设备时,数据会丢失。有人知道为什么会这样吗?
提前感谢大家!
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();
}
}