08-12-2008 11:00 PM
Hello,
I programmatically added a message to the folder of type Folder.INBOX inbox using the following code:
try {
final StringBuffer sb = this.getMessageString(textMsg, params);
final Message newInboxMsg = new Message();
newInboxMsg.setContent(sb.toString());
newInboxMsg.setFrom(_fromAddress);
newInboxMsg.setSentDate(new Date(textMsg.getCreateTimestamp()));
newInboxMsg.setInbound(true);
String subject = textMsg.getTextMessage();
newInboxMsg.setSubject(subject);
final Session session = Session.waitForDefaultSession();
final Store store = session.getStore();
final Folder[] folders = store.list(Folder.INBOX);
final Folder inbox = folders[0];
inbox.appendMessage(newInboxMsg);
} catch (final MessagingException e) {
// meh
}
I have two problems when I add a message this way:
1. The folder icon doesn't change as it does when I get real e-mail.
2. The unread message count icon (folder icon) show as 2 instead of 1. (Screenshot: check alert icon under Wi-Fi icon)

I see the same behavior on the sim as well as device. Is there anything that I am doing wrong?
Regards
Rohit
08-13-2008 10:52 AM
For #1, the messages application doesn't display the red "splat" when you programmatically display a message.
For #2, are you saying that the undread message count is 0 (not shown) but then shows up as 2 unread messages when you add your new message (and there are no other unread messages)? If so, what BlackBerry model and handheld software version are you testing on? You can find this under Options, About on the BlackBerry.
08-13-2008 10:56 AM
For #2, are you saying that the undread message count is 0 (not shown) but then shows up as 2 unread messages when you add your new message (and there are no other unread messages)? If so, what BlackBerry model and handheld software version are you testing on? You can find this under Options, About on the BlackBerry.
Correct. It goes from 0 to 2.
Device info:
Blackberry 8820
v 4.2.2.169 (Platform 2.4.0.67)
08-13-2008 10:57 AM
Is there any way I can achieve # 1?
Regards
Rohit
08-14-2008 09:58 AM
There is no way to achieve #1 programmatically.
I have been able to reproduce #2 and have also verified that the issue is fixed in BlackBerry handheld software version 4.5.0.
09-15-2008 05:52 AM
I have also encountered the same problem, even on the new 4.5 simulator. The counter still increases by 2.
The #1 problem can be solved using "msg.setStatus(Message.Status.RX_RECEIVED, 1);". When the message is opened, the icon is changed. However, I still don't know how to show the message as received in blue instead of having it yellow.
Regards
ftoure
09-15-2008 10:54 AM
ftoure wrote:However, I still don't know how to show the message as received in blue instead of having it yellow.
Can you elaborate on what you mean here? What are you trying to change the colour of?
09-23-2008 05:18 AM
Here are the different kind of messages that I found, playing with different parameters: received not opened, received (doesn't change when opened), opened. It sounds that there are some other possible states, for example, when an SMS is received, the envelop is blue. The yellow envelop is the standard behaviour for a received mail. The only remaining problem is the counter that increases 2 by 2.
09-23-2008 11:51 AM
I'm not able to view the image you posted. The URL seems to point to you hard drive. Do you have a public URL of the image?
09-24-2008 05:39 AM