Welcome!

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

Reply
Highlighted
Developer
Posts: 32
Registered: ‎03-11-2014
My Device: 8520
My Carrier: 8520
Accepted Solution

Blackberry Button- Help

Hy everyone, i am a beginner in Blackberry development, and i am trying to create a button that when it is presed it goes to another screen. I have no idea how to do this, so could anyone help me with an example or something that i can use as a starting point?

Contributor
Posts: 49
Registered: ‎12-29-2011
My Device: 9800
My Carrier: vodafone

Re: Blackberry Button- Help

Hi,

 

try this:

 

ButtonField btn= new ButtonField("Press Me", ButtonField.CONSUME_CLICK);
btn.setChangeListener(new FieldChangeListener() {

public void fieldChanged(Field field, int context) {
UiApplication.getUiApplication().pushScreen(new nextScreen());
}
});
this.add(btn);

 

Thanks,

 

Developer
Posts: 32
Registered: ‎03-11-2014
My Device: 8520
My Carrier: 8520

Re: Blackberry Button- Help

Thank's man, that really helped me