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


2711-NM11 PCMCIA Linear Flash Memory Card 256KB Fast Shipping AB 2711NM11 picture

2711-NM11 PCMCIA Linear Flash Memory Card 256KB Fast Shipping AB 2711NM11

$350.66



SeeSii NanoVNA-H4 Vector Network Analyzer 4

SeeSii NanoVNA-H4 Vector Network Analyzer 4" Handheld TFT MF Antenna Analyzer

$59.99



Kitchen Brain Fast Z080120HFC Digital Timer, 8-Timers, Memory, 120V Fast 81308 picture

Kitchen Brain Fast Z080120HFC Digital Timer, 8-Timers, Memory, 120V Fast 81308

$175.00



Nightingale CXO 6200 Memory Foam, New Headrest, Lumbar Support Ergo Office Chair picture

Nightingale CXO 6200 Memory Foam, New Headrest, Lumbar Support Ergo Office Chair

$415.00



CORSTAT INTEGRATED CIRCUIT EXPANDED MEMORY DIP REV. A SER. B 2711-NM3 picture

CORSTAT INTEGRATED CIRCUIT EXPANDED MEMORY DIP REV. A SER. B 2711-NM3

$174.95



OKTIS-2 Portable Fuel Tester Analyzer Meter Octane Number Gasoline Petrol Cont picture

OKTIS-2 Portable Fuel Tester Analyzer Meter Octane Number Gasoline Petrol Cont

$196.93







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