×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    10

    Cannot delete RecordStore in Nokia emulator

    I have a MIDlet that incorporates an 'autosave' function - when the MIDlet is shutdown, the state is saved to a RecordStore. The exception to this is when the MIDlet is shutdown from the 'Exit' option on my main menu - in this case, the autosave RecordStore should be deleted.

    I am achieving this by calling destroyApp(false) from the exit method. Then, in destroyApp I know that if the unconditional flag is true it is a forced shutdown and I want to autosave - otherwise it is a user requested shutdown and I want to delete the existing autosave.

    The problem I am having is that the autosave RecordStore is never being deleted. I am calling

    RecordStore.deleteRecordStore("autosave");

    and it is executing without an exception, but it still exists when I next start the emulator. This works in the Sun Wireless Toolkit emulator and in a Sony-Ericsson emulator I have, but not the Nokia one (I am using the 7210).

    Anyone any ideas why??

    P.S. I know that the RecordStore is closed before I try to delete it, so that's not the problem.

  2. #2
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    53
    What you can do is to forget about physically deleting the autosave file, and use a flag (lets say record id 1, type boolean) instead.

    >>I am achieving this by calling destroyApp(false) from the exit
    >>method. Then, in destroyApp I know that if the unconditional
    >>flag is true it is a forced shutdown and I want to autosave -

    rs.setRecord(1, true, 0, 1);

    >>otherwise it is a user requested shutdown and I want to
    >>delete the existing autosave.

    rs.setRecord(1, false, 0, 1);

    This works on the emulator as well as on the hardware, and if the autosave flag is set to false upon startup, just ignore the save...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×