黑莓备用入口点 - 开始从后台应用程序(推送邮件点击)应用 [英] blackberry alternate entry point- start app from background application(on push message click)
问题描述
我想从一个后台应用程序中打开我的UI应用程序。如何做?
I want to open my UI app from a background application. How its done ?.
public static void main(String[] args) {
if (args.length > 0 && args[0].equals("MYAPP") ){
theApp = new App();
theApp.enterEventDispatcher(); ///this is my ui class
}
else {
BackgroundApplication app = new BackgroundApplication();
app.setupBackgroundApplication();
app.enterEventDispatcher(); ///this is a background application listen for push notifications
}
}
当我收到推送通知,在 BackgroundApplication
应提醒弹出。
当我点击弹出,我希望它打开UI界面。如何做到这一点?我想这样的:
When I get a push notification, the BackgroundApplication
should alert a popup.
When I click the popup, I want it to open the UI screen. How is this done? I tried this:
int modHandle = CodeModuleManager.getModuleHandle("MYAPP");
ApplicationDescriptor[] apDes = CodeModuleManager.getApplicationDescriptors(modHandle);
try {
ApplicationManager.getApplicationManager().runApplication(apDes[0]);
} catch (ApplicationManagerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
但它不开放的用户界面。
But it's not opening the UI.
推荐答案
您应该通过参数MYAPP对正在运行的应用程序code:
You should pass argument "MYAPP" to code that's running application:
ApplicationDescriptor[] appDescriptors =
CodeModuleManager.getApplicationDescriptors(
CodeModuleManager.getModuleHandle("MYAPP"));//.Cod file name
ApplicationDescriptor appDescriptor = new ApplicationDescriptor(
appDescriptors[0], new String[] {"MYAPP"});
ApplicationManager.getApplicationManager().runApplication(appDescriptor);
阅读更多<一个href=\"http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800620/How_To_-_Launch_a_third-party_application_from_another_third-party_application.html?nodeid=1094023&vernum=0\"相对=nofollow>这里
这篇关于黑莓备用入口点 - 开始从后台应用程序(推送邮件点击)应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!