Problems you have encountered and solved

Problems you have encountered and solved

by Tony deLaubenfels -
Number of replies: 7

While working on apps in lab or elsewhere, everyone encounters problems. Please describe a problem you have encountered and how you solved it (solved with help is fine).


In reply to Tony deLaubenfels

Re: Problems you have encountered and solved

by Chell Robinson -

We were having issues with making toasts show up in the end of the Chapter 5 CheatActivity after modifying the toasts to recognise when someone has been cheating. Turns out, I had nested the if/else statements incorrectly and made it so the Toast.makeTest() declaration was stuck in an else statement that had little to do with the toasts. A single curly bracket moved up or down a line makes a huge difference...

In reply to Tony deLaubenfels

Re: Problems you have encountered and solved

by Tony Baker -
One of my TextViews and one of my Buttons (answer_text_view and show_answer_button) were listed as invalid and I didn't know why, since I couldn't see any errors with the code I was writing. I went back through where it was referenced in the XML file and I found out that I had spelled them wrong the first time I referenced them.
In reply to Tony deLaubenfels

Re: Problems you have encountered and solved

by Kat Sayrs -

Once, my code "could not resolve symbol R." This can be caused by several things, but usually it means there's a typo or something else wrong in an xml file. I had misspelled a word on accident. After fixing it and rebuilding, it worked fine. Sometimes just rebuilding the project alone will get rid of the error message, too.

In reply to Tony deLaubenfels

Re: Problems you have encountered and solved

by Ryan Conrardy -

I was having trouble getting my buttons to appear.  Several people came to help me, and it wasn't till much later that one of them finally noticed that I had made what was supposed to be a public class private, and misspelled another part of the code.  But the XML file never threw and error so it was hard to find.  

In reply to Tony deLaubenfels

Re: Problems you have encountered and solved

by Emily Andrulis -

We encountered a syntax error once where we were trying to override a method, but we accidentally were starting with a capital letter instead of camel case, and it caused various problems for us. Luckily, since we were trying to override an existing method, it pointed us in the right direction because it didn't like us overriding a method that didn't exist.

In reply to Tony deLaubenfels

Re: Problems you have encountered and solved

by Natalie Powell -

At one point, my GeoQuiz App kept crashing after I had made some seemingly insignificant changes to the code, and I couldn't figure out why. Eventually I realized that in trying to change LinearLayout to RelativeLayout by changing Linear to Relative and keeping Layout, it had auto-completed into RelativeLayoutLayout. Sometimes you must remember to read through very carefully for typos.

In reply to Tony deLaubenfels

Re: Problems you have encountered and solved

by Nobuki Harata -

My biggest problem was naming a class wrong, but using the name in the book, so they didn't line up. It took a while to figure out, but once I saw the problem, it was an easy fix.