Null Pointer Exception fixed.
Printable View
Null Pointer Exception fixed.
All that stuff you are doing with and without doing other stuff does not matter at all for your problem. Your problem boils down to you are using a variable you did not initialize yet. The error message tells you the name of the variable and the line number where it is being used without being initialized. Figure out what variable has not been initialized. Look at your program and decide what the value should be at the time it is being called. Look back at your program to where that value was supposed to have been assigned. If you think it is good, try a toString on it and see what it is.