Error I am getting:
Sorry!
The application {name} (process {package}) has 开发者_开发问答stopped unexpectedly. Please try again.
The application fetches some data from the internet (my server) and then parse's it to take the data out of the XML. The program does not crash if the data is the same every time (empty every fetch or populated). But it seems to crash when the data changes even though the variables are not set as final and specify "new" on each instance.
The question: is it possible to diagnose the problem more fully from Android? I am not getting any messages in the console (developing live on the phone linked to eclipse).
Thanks for your help!
To diagnose problems in Android it is important to look at the Logcat output. This is the standard output for all Android applications. If this is not helping you could think about using try/catch blocks around the problematic code part or I also would recommend to register a global UncaughtExceptionHandler that catches all exceptions that are nowhere else catched.
You could add a try/catch clause perhaps or typical Log.e messages wherever you feel it's crashing and print the stackTrace. If it's linked to Eclipse, then the debugging messages should appear (unless you set your manifest feature to be non-debuggeable).
One thing to try is to look at the data that works and the one that doesnt, and note the differences. Then, in the xml that works, add a line of the xml that doesnt work. Do this line by line to determine what part (if at all it does) causes the error. This is assuming your code is okay but the data being sent is wrong.
Hm, before doing this make sure it is a data issue and not code.
精彩评论