开发者

How to delete an object store on Persisten Object on Blackberry?

I have a class with name DataContext th开发者_运维问答at use Hashtable to save data to Persistent Object. Example I save two object:

DataContext data = new DataContext();
data.set("object1", EditField1.getText();
data.set("object2", EditField2.getText();
data.commit();

I only want to delete data of "object1" ( not delete data of "object2" ), so i can not use data.clear(); I make like this code:

if(data.get("object1")!=null){
data.set("object1",null);
data.commit();
}

But I received error " App Error 104 NullPointerExceptions ". How I can to delete data of "object1" ? Please help me.


Binh - VietNam


If you want to remove an element from a Hashtable then use the remove() method of your hashtable object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜