BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 06-25-2009, 12:09 AM   #1
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
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
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
koic
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Default

Question remains "Is your app still running or not?"
Offline  
Old 06-25-2009, 10:14 PM   #5
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
BB1364
Thumbs Must Hurt
 
Join Date: Oct 2007
Model: 7100i
PIN: N/A
Carrier: Dont know
Posts: 195
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Lot of OEM APPLE iPAD LCD And White Front Glass Replacement 6091l-1402C picture

Lot of OEM APPLE iPAD LCD And White Front Glass Replacement 6091l-1402C

$17.99



A1618 NEW OEM Battery for MacBook Pro 15

A1618 NEW OEM Battery for MacBook Pro 15" Retina A1398 Mid 2015 020-00079

$43.90



Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013 picture

Genuine A1417 OEM Battery Apple Macbook Pro 15 Retina A1398 Mid 2012 Early 2013

$40.90



NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch picture

NEW OEM Battery A1466 A1369 A1496 A1405 A1377 A1466 for MacBook Air 13 inch

$31.90



OEM Battery for MacBook Pro 17

OEM Battery for MacBook Pro 17" A1309 A1297 Early 2009 Mid 2009 2010 MC226

$40.90



NEW OEM A1618 Battery for Apple MacBook Pro 15” Retina 99.5Wh A1398 Mid 2015 picture

NEW OEM A1618 Battery for Apple MacBook Pro 15” Retina 99.5Wh A1398 Mid 2015

$43.90







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