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

Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.

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,026
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