Blackberry アプリケーションで代替エントリポイントをセットアップする方法。2 つのアプリケーションがあります。
- UI アプリケーション
- バックグラウンド アプリケーション: 自動起動時に実行されます。
これに関する Blackberry ナレッジ センターの記事があり、私はそれを試し、次のようにコーディングしました。しかし、アプリケーションのアイコンをクリックしても反応がありません。
class EntryPointForApplication extends UiApplication {
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.enterEventDispatcher();
backApp.setupBackgroundApplication();
} else {
// Start a new app instance for GUI operations.
EntryPointForApplication application = new EntryPointForApplication();
application.enterEventDispatcher();
}
}
}
クラス UI アプリケーション
class GUIApplication extends MainScreen {
public GUIApplication(){
add(new LabelField("Hello World"));
}
}
バックグラウンド アプリケーション
class BackgroundApplication extends Application {
public BackgroundApplication() {
// TODO Auto-generated constructor stub
}
public void setupBackgroundApplication(){
}
}
この(編集) 悪いリンク
に従って Blackberry_App_Discriptor.xml を構成しまし
た。