質問

私のブラックベリーシミュレーター i m走行用その背景にはもっといろいretriveのアプリケーションの背景のもの。いかない。ることができるアプリケーションの背景のもの。

役に立ちましたか?

解決

リスト切り替え可視の応用

altテキストhttp://img195.imageshack.us/img195/7003/applist.png リンクテキストをドキュメントhttp://img32.imageshack.us/img32/9273/applistmenu.png

コード:

class Scr extends MainScreen {

    ApplicationDescriptor[] mAppDes;

    public Scr() {
        listApplications();
    }

    void listApplications() {
        ApplicationManager appMan = 
            ApplicationManager.getApplicationManager();
        mAppDes = appMan.getVisibleApplications();
        add(new LabelField("Visible Applications:"));
        for (int i = 0; i < mAppDes.length; i++) {
            boolean isFG = appMan.getProcessId(mAppDes[i]) == appMan
                    .getForegroundProcessId();
            String text = (isFG ? "[F]:" : "[B]") + mAppDes[i].getName();
            add(new LabelField(text));
        }
    }

    protected void makeMenu(Menu menu, int instance) {
        super.makeMenu(menu, instance);
        menu.add(refreshApps);
        makeAppMenuItems(menu);
    }

    MenuItem refreshApps = new MenuItem("Refresh", 0, 0) {
        public void run() {
            deleteAll();
            listApplications();
        }
    };

    class AppMenuItem extends MenuItem {
        ApplicationDescriptor mAppDes;
        public AppMenuItem(ApplicationDescriptor appDes) {
            super(appDes.getName(), 100000, 100000);
            mAppDes = appDes;
        }
        public void run() {
            ApplicationManager appMan = ApplicationManager
                    .getApplicationManager();
            int processId = appMan.getProcessId(mAppDes);
            appMan.requestForeground(processId);
        }
    }

    void makeAppMenuItems(Menu menu) {
        for (int i = 0, cnt = mAppDes.length; i < cnt; i++)
            menu.add(new AppMenuItem(mAppDes[i]));
    }
}

他のヒント

<のhref =「http://www.blackberry.com/developers/docs/4.5.0api/net/rim/device/api/system/RuntimeStore.html」のrelのためのAPIリファレンスを見てみましょう= "nofollowをnoreferrer"> RuntimeStore を。

と<のhref = "http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800639/How_to_-_Make_a_running_UI_application_go_to_the_background_and_resume_in_the_foreground.html?nodeid=800545&vernum=0" のrel = 「nofollowをnoreferrer」>バックグラウンド/フォアグラウンドにアプリケーションを切り替える方法のナレッジベースエントリーます。

グッドラック!

そうでもない答えが、システム私はコメントせません。

は、あなたが本当に実行しているバックグラウンドアプリケーションが何であるかを知っておく必要がありますか、またはあなたのアプリケーションがバックグラウンドで実行されているだけの場合。後者の場合、私はあなたがランタイムストアを使用して何かを構築することができます想像します。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top