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

Posts: 32
Registered: ‎08-13-2012
My Device: 9800
My Carrier: Rogers
Accepted Solution

Add Label to MainScreen

[ Edited ]



I have a BarcodeScanner which is added to a mainScreen via its getViewFinder().. the goal is that I need to add some type of label to the screen that can show the status of the scan.. for instance, if the scan was successful then I want to display a status of "scan was complete" over the scanner. I don't want to get too caught up with when do set the status but rather how to set a label in the screen object with the scanner field!


Any insight would be appreciated.


MainScreen screen = new VideoScreen();
					BarcodeScanner scanner = new BarcodeScanner(decoder,listener);
screen.add(/* some labelField here doesn't work*/);


Posts: 17,017
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Add Label to MainScreen

well, with setDisplayFullScreen you might occupy the whole screen.
maybe you can use setTitle or setStatus to add a field, not sure how it is implemented, otherwise you would have to set the size manually and avoid the fullscreen setting.
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Posts: 84
Registered: ‎07-22-2011
My Device: bb-9550,bb-9700
My Carrier: bb developer

Re: Add Label to MainScreen



You should hide the current screen in invokeLater() and display the message in a alert.....