07-22-2008 05:01 AM
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.
07-22-2008 11:23 AM
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.
08-27-2008 09:12 AM
You can see an example of this on the last line of code in this sample.
08-27-2008 10:09 AM
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.
08-27-2008 11:22 AM
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.