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: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha
Accepted Solution

popScreen not working

Hi,

 

I am using pushScreen to move to next screens... And, now I am trying to use popScreen to go back. But, this is not working.. Am I writing the code in correcr manner.... plz. suggest.

 

Code I m writing is:

 

       if(s.equals("pop") )
                        {
                       
                            UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());
                      
                        } 

 

===========================================

 also,I hv tried this:

===========================================

 

      if(s.equals("pop") )
                        {
                       
                            UiApplication.getUiApplication().popScreen(this));
                      
                        }  

 

thanks, in advance

Kanak Sony 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: popScreen not working

What is that s.equlas( "pop" ) ? Is that condition gets satisfied?
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: popScreen not working

What happens when to code is executed?

Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: popScreen not working

Hi,

 

you are writing write statement or poping screen but did you tried debugging it whether it is entering into the condition or not.

 

Thus it give any exception on device or on simulator.

 

can you post the exact code that you are using.

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: popScreen not working

Another question! Do you have a screen behind it, so that when you pop it out you can see the screen behind it!
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: popScreen not working

Yes, "pop" is the condition to be satisfied on which I want the screen to be popped. I m creating a ButtonField and implementing FieldChangeListener to it. The code, I m using is as below. This is working fyn with another project but not with that where I want it...!!

  public class ABC extends MainScreen implements FieldChangeListener {
 
    EditField e1;
    ButtonField b1;

     public ABC( )
     {

               e1 = new EditField();
               b1 = new ButtonField("pop");
               b1.setChangeListener(this);

 
             public void fieldChanged(Field field, int context)
            {
                       if (field instanceof ButtonField)
                       {
                              String s = ((ButtonField)field).getLabel();

                   

                                if(s.equals("pop") )
                                {
                      
                                       Dialog.alert("I m inside POP..!!");
                                       UiApplication.getUiApplication().popScreen(this);
                                       Dialog.alert("I m after POPScreen");
                                }

                       }

            } 

    }

}

 

There is a screen behind this screen.I hv alittle confusion about, that previous screen takes arguments from ContactList in its constructor.Does it is creating a problem..?

 

Kanak

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: popScreen not working

Hi,

 

Are you able to see dialogs

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: popScreen not working

Yes, both dialogs are visible..
Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Developer
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: popScreen not working

[ Edited ]

"this" here actually not refers to the current screen, rather it refers to the FieldChangeListener Smiley Tongue Use getActiveScreen method

 

Cheers.. 

 

EDIT: Not so, it refers to the screen else it would throw error .. 

Message Edited by mantaker on 04-16-2009 12:03 PM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: popScreen not working

Hi,

 

Is there anything on your previos screen for display, can you post code for that screen also

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish