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
Trusted Contributor
Posts: 167
Registered: ‎06-30-2011
My Device: n/a
My Carrier: Koodo
Accepted Solution

popScreen help

I am trying to create a 'back' button that will pop the currect screen and go to the first screen under it on the stack. I've learned how to pushScreens (thanks guys!) and I assumed popScreen would work almost the same way. Could someone please point out what is wrong with this code, couldn't find it in my books Smiley Sad  Thanks! Oh and eclipse is saying 'this' inside the brackets is the problem

 

ButtonField backBut = new ButtonField(" Back ", Field.FIELD_HCENTER) {
        protected boolean trackwheelClick(int status, int time){
           
            UiApplication.getUiApplication().popScreen(this);
            return true;
                        }       
    };

//extra code

Regular Contributor
Posts: 96
Registered: ‎06-09-2011
My Device: sdk 9800
My Carrier: java development

Re: popScreen help

Hi question man..........to popup the current screen try the following code....

it will work......if any problem reply me......

UiApplication.getUiApplication().popScreen(Ui.getUiEngine().getActiveScreen());

Press the Kudos button (star) on the left side to thank and
please mark the Thread as solved if its solved...


Thanks and Regards
Nagarjuna
Highlighted
Super Contributor
Posts: 278
Registered: ‎11-04-2010
My Device: 4.5 and above
My Carrier: none

Re: popScreen help

Hi,

        Give class_name.this inside like

   UiApplication.getUiApplication().popScreen(className.this);

  and check whether it works.

 

Thanks & Regards

    pp