如何在Blackberry应用程序中设置备用入口点?

如何在Blackberry应用程序中设置备用入口点?,第1张

如何在Blackberry应用程序中设置备用入口点?

尝试记录args和args
[0](如果不为null)的值,以查看实际传递给main()的内容。您的编译过程可能存在问题,其中后台模块未传递参数(或未传递正确的值)。

另外,请尝试将EntryPointForApplication实例保存到静态变量中,以使其维护引用(不进行垃圾收集),并且如果在运行状态下再次从主屏幕上单击该图标,则不会启动多个实例您的应用程序。例如:

class EntryPointForApplication extends UiApplication {    private static EntryPointForApplication theApp;    public EntryPointForApplication() {         GUIApplication scr = new GUIApplication();         pushScreen(scr);  }    public static void main(String[] args) {        if ( args != null && args.length > 0 && args[0].equals("background1") ){ // Keep this instance around for rendering // Notification dialogs. BackgroundApplication backApp=new BackgroundApplication(); backApp.setupBackgroundApplication();    backApp.enterEventDispatcher();       } else {     if (theApp == null) {  // Start a new app instance for GUI operations.       theApp = new EntryPointForApplication();  theApp.enterEventDispatcher();       }        } }   }


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5130579.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-11-17
下一篇2022-11-17

发表评论

登录后才能评论

评论列表(0条)

    保存