![]() | Chapter 3 Force Close Issue |
|
30 Jun 2010, 06:40
chris moore (2 posts) |
I have read through some of the other issues that seem to occur in this area and have followed in comparison to the code samples provided. Issue occurs from page 66 where we are declaring About in the manifest. I added the code but I still get the same force close message on launch. Eclipse gives the following in console but not sure where else to look. No problems flagged and have tried “clean.” It has been smooth sailing up until now so just curious where I can look to knock out this issue.
|
|
30 Jun 2010, 21:06
Ed Burnette (1316 posts) |
I looked at the zip you sent. If you run the program and open the LogCat view it shows this exception:
The important part is “NullPointerException … at org.example.sudoku.Sudoku.onCreate(Sudoku.java:34)”. Line 34 says:
so exitButton must be null. That means this findViewById call failed on line 33:
So search your XML files for the string “exit_button”. You’ll find it’s defined in res/layout-land/main.xml but not in res/layout/main.xml. Looks like you defined the about button twice by mistake in res/layout/main.xml. Your program would work in landscape mode but not in regular portrait mode. |
|
02 Jul 2010, 04:25
chris moore (2 posts) |
Ed, Thank you so much for your assistance. Sorry I couldn’t thank you yesterday-I really do appreciate all the support you give to your readers! |
|
16 Jul 2010, 19:13
Ed Burnette (1316 posts) |
You’re welcome! |
| You must be logged in to comment |

