Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 32
Registered: ‎10-03-2011
My Device: 9900
My Carrier: developer

Delete Record problem



I have a RecordStore with some records in there. These Records will be displayed in List format on the screen. When I select a record I will delete this record from the RecordStore by pressing the "Delete" Command.

At the moment I do it with this command:

It works fine but it seems to me that the content will be deletet but the "space" remains.

RecordStore at the beginning:
ID item
1 item1
2 item2
3 item3

RecordStore after deleteing item with ID=2:
ID item
1 item1
2 null
3 item3

The problem is that I display all the items in a list after deleting a item, so a "NullpointerException" comes when I do this.
I thought that the RecordStore sorts himself after deleting an item, so that it has to look like this:

ID item
1 item1
2 item3

This is what I expected but I think it is like the example above with the null value.
So is there any way to delet a Record without having a null value in my RecordStore????

I hope my question is not too confusing but it's hard to explain.
If sb. can help me would be very nice.

Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Delete Record problem

maybe just check for null?
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter