Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Contributor
flo_badea
Posts: 2
Registered: 02-10-2012
My Carrier: 0123456789
Accepted Solution

bbm BasicMessageListManager dissapears when i open the screen menu

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_SAME_SENDER|
		MessageListManager.MESSAGE_STYLE_SHOW_SENDER_DISPLAY_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.

Please use plain text.
New Contributor
flo_badea
Posts: 2
Registered: 02-10-2012
My Carrier: 0123456789

Re: bbm BasicMessageListManager dissapears when i open the screen menu

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.

Please use plain text.