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
Thecr0w
Posts: 178
Registered: ‎02-20-2011
My Device: 8700
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 #



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

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()).

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

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. 

Trusted Contributor
Thecr0w
Posts: 178
Registered: ‎02-20-2011
My Device: 8700

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 #



Trusted Contributor
Thecr0w
Posts: 178
Registered: ‎02-20-2011
My Device: 8700

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 #