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
Contributor
Posts: 39
Registered: ‎02-18-2013
My Device: Developer
My Carrier: Don't Know

How to check When my Screen comes on foreground.

Hi,

 

I created a HomeScreen class which extends MainScreen.

 

I need to check a condition when my HomeScreen comes on foreground.

 

How can I check it. ?

 

Regards,

Ajay Sharma

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

Re: How to check When my Screen comes on foreground.

You can't tell if a screen comes to the foreground, but you can tell if your application comes to the foreground.

 

Look for the

<Application>.activate() method. 

 

From a screen you can tell if it has been hidden and is not visible using the '<screen>.onExposed() method.  But there are a number of conditions that will drive that, not just coming to the foreground. 

 

Note that activate() is driven at application start up too.