09-11-2012 08:40 AM
Can we add SystemListener as soon as any app, in blackberry, comes to foregound? I mean, how can we check when ANY app comes to foreground and add SystemListener to it?
Thanks in advance.
Solved! Go to Solution.
09-11-2012 10:18 AM
Sorry, there is not a listener or notification when an app comes to the foreground nor is there any API to access a currently running Application and thus add a System Listener to it.
What are you trying to achieve? Perhaps there are other alternatives.
09-11-2012 02:45 PM
I have a requirement to do some startup work when ANY application starts, when Blackberry device is turned on..
I have the following code in my Application which implements SystemListener:
public void powerUp() {
System.out.println("BlackBerry is powering up");
StartUpWork();
}
I want to add MySystemListener to every Application as soon as that app comes to foreground. Is this possible?
09-11-2012 02:52 PM
You cannot add a listener to another application.
You might be able to look at "active" applications and figure out which one has the focus. You could also detect when one starts or stops using the ApplicationManager.getVisibleApplications
09-11-2012 03:30 PM
Ohk, Thanks RexDoug..