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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Trusted Contributor
Thecr0w
Posts: 178
Registered: ‎02-20-2011
My Carrier: at&t
Accepted Solution

Will popScreen() call onClose()?

Hi all, 

There are two way of close screen,  they are onClose() and popScreen()? Both of them will go back to the previous screen stack, my question is : will popScreen() call onClose() as well?

# I tried to change the world, but I couldn't find the source code #



Please use plain text.
Developer
pbrebs
Posts: 40
Registered: ‎09-08-2011
My Carrier: AIS

Re: Will popScreen() call onClose()?

It is Screen.close() which closes the screen.

 

onClose() can call close(), after potentially asking the user whether to save changes.

 

I suggest you take the time to check - I would expect that popScreen() calls close() (but not onClose()).

Please use plain text.
Developer
peter_strange
Posts: 17,959
Registered: ‎07-14-2008

Re: Will popScreen() call onClose()?

My understanding is that popScreen will not call close() or onClose().  It will just pop the screen.

 

But as the previous poster said, this is easy to test. 

Please use plain text.
Trusted Contributor
Thecr0w
Posts: 178
Registered: ‎02-20-2011
My Carrier: at&t

Re: Will popScreen() call onClose()?

Yes, popScreen will not call close() or onClose().
What I need is a common method between close() and popScreen().
onExposed() does not work either, is there something common in both?

# I tried to change the world, but I couldn't find the source code #



Please use plain text.
Trusted Contributor
Thecr0w
Posts: 178
Registered: ‎02-20-2011
My Carrier: at&t

Re: Will popScreen() call onClose()?

I found it. onUiEngineAttached() did the trick! thank you all the same.

# I tried to change the world, but I couldn't find the source code #



Please use plain text.