Changes

Jump to: navigation, search

Lab BlackBerry Example

496 bytes added, 12:27, 27 February 2011
no edit summary
The second screen must have a title, textfield, and button to let the user go back to the first screen.
 
* Title
For the title one could use:
void net.rim.device.api.ui.container.MainScreen.setTitle(Field arg0)
Thus, to set the title of the screen you can write the instruction:
setTitle(new LabelField("Second Screen !", LabelField.USE_ALL_WIDTH));
 
* Text Field
Fot the screen text, one can use
net.rim.device.api.ui.component.RichTextField
public RichTextField(String text, long style)
 
that constructs a plain RichTextField object in the specified style
To add the field to the screen you invoke the method
void net.rim.device.api.ui.Screen.add(Field arg0)
 
Thus, to add the text field to your screen you have to write the following instruction:
add(new RichTextField("Here is the second activity", Field.NON_FOCUSABLE));

Navigation menu