开发者

detect when blackberry App is Auto-started at boot up time vs started by user

开发者 https://www.devze.com 2023-03-07 06:08 出处:网络
I want to have my app automatically run at start time in order to register with the HttpFilterRegistry.I know how to make开发者_C百科 my app auto-start but what I\'m really after is differentiating be

I want to have my app automatically run at start time in order to register with the HttpFilterRegistry. I know how to make开发者_C百科 my app auto-start but what I'm really after is differentiating between when the sytem starts the app and when the user starts the app. If the user is starting the app, I want to just show the GUI. If it's the system, I want to just register the HTTP filters.

Is this possible?


When you create your Alternate Entry Point, specify an "Application argument". When the app launches you can do this in your main() method

//Autostart
if( args != null && args.length > 0 && args[0].equals("the_application_argument")) {
    //register HTTP filters
}

//User start
else{
    //launch the GUI
}


there is a function called inStartup() in application Manager class Determines if the device is in the process of starting up. so you can check on it. i think its better than create new entry point and pass an arguments to main

0

精彩评论

暂无评论...
验证码 换一张
取 消