04-25-2012 06:55 PM
I have developed an application with an alternate entry point. I have the main GUI application and a background application that listens for push notifications. The background listener auto starts when the device is turned on and listens for push. When it receives the push message it displays a popupscreen with options 'launch' and 'cancel'. Pressing on 'launch' should open the GUI application by pushing the main application screen. However, I receive 'ClassCastException' and I have no idea why.
I have looked around and the process is similar to what I have done but it somehow is not working for me. Can anyone explain or show me how to push screen from a background application?
Solved! Go to Solution.
04-25-2012 07:16 PM
Welcome to the forums!
I suppose you push a global [and maybe modal] popup screen to display "launch" and "cancel" buttons. When you press "launch", then, you should not simply push a screen - you should actually launch the main application!
In order to do that, you should create an application descriptor with the appopriate parameters and tell ApplicationManager to run it. Take a look at ApplicationManager documentation, especially the part titled "Running an application with different arguments". Make sure the arguments are as needed for your main application, not the background one.
One problem: what if your main application is already running but minimized? Do not worry - trying to run the same application with the same arguments will activate the already running one!
04-26-2012 07:47 AM
Thanks. That was exactly what I was looking for. I resorted to pushing screen because I could not find how to launch app from the background.