×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Russia, Bryansk
    Posts
    90

    NullPointer on exiting app

    Hello! I've got a strange problem.

    My app works fine on the emulator and on Nokia 3650, but it causes a "0 java.lang.NullPointerException" while exiting on the 7610 phone.

    Please give me a hint.

  2. #2
    Registered User
    Join Date
    Mar 2005
    Posts
    34
    Does your destroyApp() method contain the following line:

    notifyDestroyed();

    Because it should.

    I had similar problems, and i introduced that line and things worked again. I think the problem is that it gets destroyed, but then the phone tries to reference it again, since there is nothing to stop it. notifyDestroyed() lets the OS know that the app has been destroyed and so can no longer be referenced.

    Åge Kruger

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Russia, Bryansk
    Posts
    90
    nope
    but I call notifyDestroyed() then I want to close my app e.g. then user chooses "Exit" or something. Maybe I should close my app another way? Or just include nutifyDestroyed() into the destroyApp()?

  4. #4
    Registered User
    Join Date
    Mar 2005
    Posts
    34
    When i close up my applications, i use some "standard" methods:

    public void destroyApp(boolean destroy){
    }

    public void exitRequested(){
    destroyApp(false);
    notifyDestroyed();
    }

    This seems to work well, hopefully it will work for you too.

    Åge Kruger

  5. #5
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Russia, Bryansk
    Posts
    90
    Thanx!

    I can't test it now but I'll post the results!

Posting Permissions

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