I have what seems like a very simple method, written in java for an android application:
EDIT 1: private String newResponse;
public SOME METHOD CALLED FIRST
{
newResponse = "";
}
END OF EDIT 1
public synchronized void reportMessage(String message)
{
try
{
newResponse = newResponse + message;
confirmQE(); //Look for qe in the message
}
catch (Exception e)
{
response = e.getCause().toString();
}
}
When I run the application in debugger mode, it 'suspends' on the line:
newResponse = newResponse + message;
It says in the debug window:
Thread[<9> Thread-10] (Suspended (exception NullPointerException))
This occurs only some of the time. Sometimes it runs the line fine.
It never goes into the catch clause and when you click continue, the app crashes. There isn't a break point on the line so I don't even know why it is suspending there.
newResponse is of type String, defined as a global variable.
Can anyone help?