![]() | Sudoku not working |
|
21 Mar 2010, 18:19
Paul Lucas (8 posts) |
Hello, first of all i would just like to say this book is very good and straight forward so thanks for that. Now for the questions 1) I am very interested in developing for android because i love the os and it seems like it will be continually growing for a while, but 2) Also ive been going through the book and i just finished chapter 4. When i run the code, everything works, except in the game, after everything draws Thanks for the help! |
|
21 Mar 2010, 23:39
Ed Burnette (1316 posts) |
Thanks for your kind words. If you could take a minute or two to write a review on Amazon that would be greatly appreciated. Here are the answers to your questions: 1. For suggestions on a Java/Eclipse book or tutorial, check out this thread:
I also wrote a little book on Eclipse you might like:
2. The problem is that in res/layout/keypad.xml you used a LinearLayout when you should have used a TableLayout. In case anybody else runs into trouble, here’s how I figured it out: I narrowed down the problem by running your version and looking in the LogCat view (Window > Show View > Other > Android > LogCat). I saw this:
That sent me to line #9 of keypad.xml which is:
TableRow is supposed to be used in a TableLayout, but I noticed that on line 2 of the same file you’re using a LinearLayout. Case closed. By the way, the error about layout_width is a little misleading here, but it happens because all the children of LinearLayout must have a layout_width. The children of TableLayout don’t need that because TableLayout can set their widths for them. Good luck, |
|
21 Mar 2010, 23:52
Paul Lucas (8 posts) |
I hope this isnt a stupid question, but how did you know it had to be in the keypad.xml file and not any of the other ones? Just because of the fact that it occurred only while opening the keypad? But thanks so much for that help, this book was especially worth the money because of this added support. I will write a review shortly on amazon, and thanks for the tips on the books. Im looking into getting that pocket guide right now because of how handy it looks |
|
22 Mar 2010, 02:02
Ed Burnette (1316 posts) |
It’s not a stupid question. I had two clues. The first was that you only got it when opening the keypad. The other was in the log file, on this line:
If you look at Keypad.java line 31 (open Keypad.java, press Ctrl+L, type 31) you see:
R.layout.keypad refers to the res/layout/keypad.xml file. Oh, I forgot to mention dzone.com has a reference card that I did with Adam Houghton. Here’s the link:
That one has a lot of nice keyboard shortcuts, and it’s free! |
| You must be logged in to comment |

