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


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.


Reply
New Developer
Posts: 33
Registered: ‎07-16-2008
My Device: bold

Get mail Status

Hi all

           how to delete an email after its delivered i get mail status using 

mail.getStaus();

 it returns only an int value how to get mail status like TX_DELIVERED or TX_PENDING

                     

                  

 

Retired
Posts: 28
Registered: ‎07-14-2008
My Device: Not Specified

Re: Get mail Status

Compare the returned integer against the Message.Status constants, if the return value you got equals the Message.Status.TX_DELIVERED then you should be able to procede with your deletion. 

Highlighted
New Developer
Posts: 33
Registered: ‎07-16-2008
My Device: bold

Re: Get mail Status

int status=mail.getStatus(); if(status==Message.Status.TX_DELIVERED) { mail.getFolder().deleteMessage(mail): }

  status retuns some value like 41576834 ?

BlackBerry Development Advisor
Posts: 15,889
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Get mail Status

This returns a bit field that could contain multiple status types.  To check for a specific type you can and it (&) with the contsant and compare to 0.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 28
Registered: ‎07-16-2008
My Device: Curve 8320

Re: Get mail Status

Hi could you show how you would do this?  ... thanks.
BlackBerry Development Advisor
Posts: 15,889
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Get mail Status

You can see an example of this on the last line of code in this sample.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/How_To_...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 28
Registered: ‎07-16-2008
My Device: Curve 8320

Re: Get mail Status

I must be missing something.  In my tests I get the following for a message delivered to the device.

 

DEBUG - msg.getStatus() = 2047
 
DEBUG - Message.Status.RX_RECEIVED = 2047
DEBUG - msg.getStatus() & Message.Status.RX_RECEIVED = 2047
 
DEBUG - Message.Status.RX_RECEIVING  = 4095
DEBUG - msg.getStatus() & Message.Status.RX_RECEIVING  = 2047
 
DEBUG - Message.Status.RX_ERROR = 1
DEBUG - msg.getStatus() & Message.Status.RX_ERROR = 1

 

So if these were compared to zero then the messge is not received, not receiving and there is no error ???  I must be reading this wrong.

 

BlackBerry Development Advisor
Posts: 15,889
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Get mail Status

The getStatus method actually returns one of the RX or TX values, not a bitmask of combined values (which is where you'd use the & operator).

 

This means you'll need to use a direct comparison (such as an if or switch case) and compare to the constant values.

 

Sorry for the mix up.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.