BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-25-2009, 12:09 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Request foreground doubt

Please Login to Remove!

Hi
In my application when open it first time i retrieve some data from server and display it. Now when i click escape on this screen i make the application to go background so that the application will be minimized and the homescreen will be shown.

But the problem is when i reopen again the application by clicking on the icon on the homescreen the i want to perform some function like calling the data from the server again. so how do i capture this event of reopening the application again. One way is i can make System.exit(0) when the escape key is pressed, but when i use this all my threads running in the background are destroyed so i cannot do this.

Is there any way how i can achieve this.

Thanks
Offline  
Old 06-25-2009, 01:27 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Either I do not understand somethn' or you are not clear.
If "make the application to go background" means that it's still running
then it may keep status, which you can use with the second "start".
If the app was completely closed then it lost the retreived data.
Offline  
Old 06-25-2009, 02:33 PM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

You need to over ride the definition of activate on your class that extends UiApplication (or possibly Application):
Code:
public void activate()

    Handles foregrounding event.

    The system invokes this method when it brings this application to the foreground. By default, this method does nothing. Override this method to perform additional processing when being brought to the foreground.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 06-25-2009, 02:58 PM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Question remains "Is your app still running or not?"
Offline  
Old 06-25-2009, 10:14 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Quote:
Originally Posted by koic View Post
Question remains "Is your app still running or not?"
The way I read this:
Quote:
Originally Posted by BB1364 View Post
Now when i click escape on this screen i make the application to go background so that the application will be minimized and the homescreen will be shown.
at least the OP intends that his application is still running. Giving the benefit of the doubt.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 06-25-2009, 11:41 PM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you all for giving attention

Thanks hrbuckley, i override the activate method and now i can perform the functions. The app still runs and when i escape it then it goes to background and in the activate() method i hv added my function so that when the running app is opened again the method is called.

Thanks once again.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.