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.
07-28-2008 03:44 AM
I developing an application with Folderlistner api.. i can get all mails from my store i got 2 problems in my application
I cant quit folderlistner. am using
removelistner method while calling exit (system.exit) after tat my application processing all emails for example my application deleting all emails from my store. how to remove folderlistner from store
when restart my application it processing emails once again i mean 2 listners working in same time not only 2
For every restart another one listner shoud added
how can i solve this problems?
to adding listner
mystore= session.getStore(); mystore.addFolderListener(this);
to removeing llistner while calling system.exit(0)
Solved! Go to Solution.
07-28-2008 03:50 AM
take a look at this article which exactly does what you are looking for:
07-28-2008 05:19 AM
07-28-2008 05:30 AM
private FolderListenerGUI folderListenerGUI = null;
//Long value: com.samples.folderListener
public static final long RTSID_MY_APP = 0x7451402f595f81a5L;
//Get the store from the default instance.
Store store = Session.getDefaultInstance().getStore();
//Add the folder listener to the store.
catch (Exception e)
//Returns an instance of the running FolderListenerApp.
public static FolderListenerApp waitForSingleton()
//Ensure this is a singleton instance.
//Open the RuntimeStore.
RuntimeStore store = RuntimeStore.getRuntimeStore();
//Obtain the reference of FolderListenerApp.
Object obj = store.get(RTSID_MY_APP);
//If obj is null, there is no current reference
//to FolderListenerApp. Start a new instance
// of FolderListenerApp if one is not running.
if (obj == null)
//Store a reference to this instance in the RuntimeStore.
store.put(RTSID_MY_APP, new FolderListenerApp());