How to know if application is at the top of the stack?

Tutorials with advanced 'difficulty' and more Lines of Code.

How to know if application is at the top of the stack?

Postby csengyee » Tue Sep 08, 2009 1:52 pm

Hi, is there any way to check whether an application is currently running at the foreground?

I heard some developers mentioned about stack? But which class in Android API should I use?
csengyee
Junior Developer
Junior Developer
 
Posts: 19
Joined: Mon Jul 13, 2009 3:07 pm

Top

Postby martin-g » Wed Sep 09, 2009 7:38 am

When your app is "on top" Android framework will call 'onStart()', when you app "go in background" you'll receive 'onPause()'
martin-g
Once Poster
Once Poster
 
Posts: 1
Joined: Wed Sep 09, 2009 7:34 am

Postby csengyee » Thu Sep 17, 2009 12:14 am

martin-g wrote:When your app is "on top" Android framework will call 'onStart()', when you app "go in background" you'll receive 'onPause()'


Thanks. I am more of trying to know whether an application (other than mine) is running in foreground. Any hint on this? Thanks.
csengyee
Junior Developer
Junior Developer
 
Posts: 19
Joined: Mon Jul 13, 2009 3:07 pm

Postby virtual » Thu Sep 17, 2009 6:08 am

Once I too needed this, but my finding was that there is no way to check the stack for your app. I needed this because when my app goes to background, clicking on the my app icon on the home screen starts it afresh rather bringing my app in background to foreground.
Regards,
Virtual
virtual
Developer
Developer
 
Posts: 26
Joined: Tue Mar 24, 2009 11:20 am

Top

Return to Advanced Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests