我正在嘗試爲黑莓手機編寫應用程序,而且我正在使用持久性存儲,但是當我重新啓動設備時,數據丟失了。任何人都知道爲什麼會發生這種情況?
在此先感謝大家!黑莓持久性商店 - 手持重新啓動後沒有數據保存
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