Welcome!

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

Reply
Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Messages gets deleted when uninstalling the application

[ Edited ]

From the API reference:

 

ViewListener

 

Implement this interface and register it with a Session (using addViewListener) to receive notifications when messages are opened or closed in the device's Message application.

 

Is that what you want to do? Because you say you are using the FolderListener when your code is using the ViewListener which isn't the same.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Messages gets deleted when uninstalling the application

Sorry, i posted a different code. But the issue are the same. Even when registering ViewListener or FolderListener, and i tried to retrieve the Store by getting the instance of the ServiceBook, Still, when uninstalling the application, the service book including the email messages gets deleted. 

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Messages gets deleted when uninstalling the application

Yeah.. I'm using the same code that I posted and I get either the default store or the full set of mail boxes on the device and set up the listeners. When I uninstall it, the messages are not removed.

 

That's why I say something in your code might be triggering the deletion. At this point, I'm not sure how I could help.

 

Sorry.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Messages gets deleted when uninstalling the application

Hi Jerome,

 

I tried your code and it only detects incoming and outgoing messages in my default mailbox and not on the other mailboxes. As mentioned in this article:

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800698/What_Is...

 

If you find something, please do update this thread. Thanks for helping out. 

Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Messages gets deleted when uninstalling the application

[ Edited ]

I use solution 2 to add a listener to all mailboxes. I know that the code I've used only selects the default but when using my code in conjunction with yours, it should just work.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 905
Registered: ‎02-07-2009
My Device: BlackBerry Torch 9800
My Carrier: Globe Telecom

Re: Messages gets deleted when uninstalling the application

Hi Jerome,

 

I tried the solution two as suggested but it can only listen to the default inbox. I cannot listen to my other inboxes in the handset. 

 

Can you provide more details on how did you manage to listen to several inboxes in your application?

 

Thank you very much!