Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 614317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:05:57+00:00 2026-05-13T18:05:57+00:00

I have an Android app modeled after the LunarLander example by Google. I am

  • 0

I have an Android app modeled after the LunarLander example by Google. I am debugging it on a real device, (Motorola Droid) with Android 2.0. When the orientation changes, the program crashes on a NullPointerException. Logcat from just before crash:

02-01 00:24:27.956: DEBUG/nate(8358): Starting Game
02-01 00:24:36.878: DEBUG/dalvikvm(1086): GC freed 1788 objects / 92256 bytes in 1389ms
02-01 00:24:38.542: INFO/WindowManager(1021): Setting rotation to 1, animFlags=0
02-01 00:24:38.558: INFO/ActivityManager(1021): Config changed: { scale=1.0 imsi=310/4 loc=en_US touch=3 keys=2/1/2 nav=2/2 orien=2 layout=34}
02-01 00:24:38.620: WARN/UsageStats(1021): Something wrong here, didnt expect org.nifong.leeder to be resumed
02-01 00:24:38.886: DEBUG/nate(8358): New Surface dimensions: 854x442
02-01 00:24:38.886: DEBUG/nate(8358): flies was null

The first line that worries me is "Something wrong here" at 24:38.620. I have no idea what it means, but I think its due to me not reacting properly to the screen change.

Next I get a debug message that I printed myself from within my own method surfaceChanged() about the new surface dimensions.

Then I print out debug message about whether flies was null. flies is the field that eventually causes the NullPointerException. Its created once, and never written to again for the rest of the program. I know that it was not null before the crash, because it was read several times.

Does anyone have a clue how my private member variable came to be null just by these clues?

I would include code but there is a lot of it and I don’t know what would be relevant.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:05:57+00:00Added an answer on May 13, 2026 at 6:05 pm

    I fixed it by adding these two lines to the activity tag in my manifest file

    android:configChanges="keyboardHidden|orientation"
    android:screenOrientation="landscape"
    

    this says that my application will handle keyboard and orientation changes on its own (by doing nothing) and prefers to run in landscape all the time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.