0

在我的黑莓应用程序中,我使用持久性、列表和线程来执行代码。代码如下:

enter code here

UiApplication.getUiApplication().invokeLater(new Runnable(){

                                public void run(){

              CategoryListScreen.getInstance(

              UiApplication.getUiApplication())

                    .setCategoryListContent();

        }

  });

公共无效 setCategoryListContent() {

        categoryList.delete(0);



        CategoryListScreen categoryListScreen = CategoryListScreen

                    .getInstance(UiApplication.getUiApplication());

        PersistentObject categoryListPersistObject = PersistentStore

                    .getPersistentObject(0x73c8d3592648fea5L);

        PersistentObject datePersistObject = PersistentStore

                    .getPersistentObject(0xe453c1c0c14b9aebL);



        categoryListPersistObject.setContents(Communicator.categoryDatas);

        datePersistObject.setContents(new Date());

        categoryListScreen.setCategoryListVector(new Vector());

        categoryDataList = Communicator.categoryDatas;

        System.out.println("-------------------- " + Communicator.categoryDatas.length);

        for (int i = 0; i < Communicator.categoryDatas.length; i++) {

              if (Communicator.categoryDatas[i] != null) {

                    if (Communicator.categoryDatas[i].getName() != null) {

                          categoryListScreen.getCategoryListVector().addElement(

                                      Communicator.categoryDatas[i].getName());

                    }

              }

        }

        testListCallback = new ListCallback();

        categoryList.setCallback(testListCallback);



        int i = categoryListScreen.getCategoryListVector().size();

        categoryListScreen.getCategoryList().setSize(i);

        System.out.println("---------------------->" + categoryListScreen.getCategoryListVector().size());

//

        categoryListScreen.getCategoryList().setRowHeight(40);



        // categoryListScreen.invalidate();

        invalidate();



        System.out.println("End.........................");

  }

该应用程序正在使用线程执行持久性并设置列表的大小。应用程序运行良好并成功退出。

但是在卸载应用程序时,设备会重新启动,并且在重新启动应用程序后,对应用程序没有影响。应用程序仍然存在。

what is the problem in uinstalling the application which uses Threads,persistance and list? why is it being restarted without any user confirmation or alert? why is it not get being uninsall after restart?

please give the resolution for the given problem or any useful code snippet ,which would be appreciated.

Thanks,

Mishal Shah

4

1 回答 1

1

Is this on a device simulator or a real device? As far as I know, if you reset the simulator, it loads back all the installed apps onto to simulator.

于 2009-11-21T08:08:23.910 回答