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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 261
Registered: ‎08-11-2009
My Device: Not Specified
Accepted Solution

Invalidating the previous screen

Hi Developers,

 

 

 

Im facing a problem.  I have 2 screen , from the first screen when button is pressed im calling the second screen , im also sending the first screen(this) to the second screen and from the second screen im trying to invalidate with the firstscreen object. even through i try to invalidate nothing is happening .

 

 

Can any one tell a soluiton for the same.

 

 

Thanks

SujithRavindranyes

 

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invalidating the previous screen

 

what exactly are you trying to achieve?

if the second screen is on top you will not able to see anything on the first one.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 261
Registered: ‎08-11-2009
My Device: Not Specified

Re: Invalidating the previous screen

Hi simon,

 

To be simple i need to invalidate a screen which on the top of the stack.

 

From the first screen on the button press im moving to the second screen . so now first screen is on the top of the  stack . now i will close the second  screen and try to invalidate the first one. but it is not working

 

 

a small briefing just to express what i want to tell . not a working code 


1) From the first screen im moving to the second screen

SosMessageScreen  sospredefinedmessageScreen = new SosMessageScreen(this);
			UiApplication.getUiApplication().pushScreen(sospredefinedmessageScreen);


2) From the second screen 

UiApplication.getUiApplication().popScreen(this);
objectoffirstscreen.invalidate

 Hope it is clear

 

Thanks 

SujithRavindran

 

 

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invalidating the previous screen

and what do you want to achieve with the invalidate?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 261
Registered: ‎08-11-2009
My Device: Not Specified

Re: Invalidating the previous screen

Hi simon,

 

After closing the  second screen certain values should be changed . I need to show the changed value by using invalidating .

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Invalidating the previous screen

invalidate does not change anything.

you have to call setText on textfields etc to set new values. this invalidates them automatically.

you can either write an update method (to call from screen2) or use on onUiEngineAttached to update the screen each time it is displayed.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 261
Registered: ‎08-11-2009
My Device: Not Specified

Re: Invalidating the previous screen

Thanks Simon,

 

 

Hope this helps 

Regular Contributor
Posts: 77
Registered: ‎05-21-2012
My Device: 9900

Re: Invalidating the previous screen

Hi Simon,

 

Can u guide how to use onUiEngineAttached for this same problem cited here programmatically or post some useful link.

Would much appreciate.

 

Thanks

 

Developer
Posts: 243
Registered: ‎07-22-2011
My Device: BlackBerry Z10
My Carrier: AirTel

Re: Invalidating the previous screen

Hi,

Here onUiEngineAttached is working if screen is attaching to main thread or stack and when screen is detaching,

it means u write onUiEngineAttached if(attached) that means screen is attaching and if(!attached) means screen is detaching..

 

 

Regards,
Lakshman K

----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

Regular Contributor
Posts: 77
Registered: ‎05-21-2012
My Device: 9900

Re: Invalidating the previous screen

Hi lakshman,

That was indeed a nice explanation. But where and how would i implement that UIEngine thing in the code i am still confused.Like shold it be in the second screen or first and how exactly to go about it

Much appreciate the help.

Thanks.