02-10-2012 03:29 AM
hi,
i'm trying to integrate my app with the blackberry messenger platform. for this i am using the BBM SDK. i am using a custom screen to display the messages. this screen contains a BasicReplyFieldManager set as the status for the screen and a BasicMessageListManager added as a direct child of the screen. Everithing is ok as long as i do not try to open the screen's menu. For example if i override the keyChar method to add the messages to the BasicMessageListManager everything is ok. if, on the other hand, i use a menu option to do this, as soon as i open the menu, the BasicMessageListManager dissapears. During debugging i found out that the BasicMessageListManager's manager is set to null. this is why it dissapears.The reply field does't dissapear because it's in the status. If i put it in a BottomUpManager for example they both dissapear.
has anyone encountered this? or does anyone know how to get around this problem?
here is the code i'm using:
replyField=new ReplyField();
smilyBtn=new SmileyButton();
smilyBtn.setClickRunnable(new Runnable() {
public void run() {
synchronized (UiApplication.getEventLock()) {
SmileyScreen scr=new SmileyScreen();
scr.show(replyField);
}
}
});
replyMgr=new BasicReplyFieldManager(replyField, smilyBtn);
messageMgr=new BasicMessageListManager(0,
MessageListManager.MESSAGE_STYLE_GROUP_MESSAGES_SA ME_SENDER|
MessageListManager.MESSAGE_STYLE_SHOW_SENDER_DISPL AY_NAME,
MessageListManager.BORDER_STYLE_BUBBLE);
messageMgr.toggle();
BottomUpManager mgr=new BottomUpManager();
mgr.add(messageMgr);
mgr.add(replyMgr);
add(mgr);
to add messages i'm using this
MessageSender ms=new MessageSender("Me");
TextMessage tm=new TextMessage(message, ms);
OutgoingTextMessageField out=new OutgoingTextMessageField(tm);
messageMgr.addMessage(out);
thank you.
Solved! Go to Solution.
02-10-2012 06:05 AM
found the answear. it had nothing to do with the BBM SDK classes.
i turns out that i overrode the makeMenu method in the screen class and in there i called menu.deleteAll. Once i removed this line everything was ok.