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
Developer
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind
Accepted Solution

Close() popup not working

trying to close a popup screen as shown: 

 

Ok.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {
two.deleteAll();
two.add(lockedtext);
power.setLabel("Unlock");
save.add(power);
choicewas = "Unlock";
pboptions[2] = "Unlock";
PowerButtonOptions.setChoices(pboptions);
String code = makenote.getText() + "";
contents[current] = encryption + code + coded;
locked = true;
close();
}
});

it does note close when I run this and I am wondering why. If I just have this, 

Ok.setChangeListener(new FieldChangeListener() {
public void fieldChanged(Field field, int context) {

close()

}

});

it will close, why does putting the rest in effect it?

Developer
Posts: 40
Registered: ‎09-08-2011
My Device: 8900
My Carrier: AIS

Re: Close() popup not working

Presumably there's a runtime error, so close() isn't run.

 

To check, wrap the code above the close() in a try..catch.

Developer
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Re: Close() popup not working

no longer an issue, thanks!