The below program throws a NullPointerException. In Log cat it shows:
01-09 20:40:34.366: D/RemoteIt(2809): java.lang.NullPointerException
Your question, as stated, asks about how to troubleshoot this.
You need to figure out what's null on the line throwing the Exception. To do that, you take a look at the stack trace to see which line is causing the problem. Then you either step through your program with a debugger (or a piece of paper and a pencil) or just add print statements to figure out which variable is null.
When you know which variable is null, you can trace back through the program to figure out why it's null. When you know why it's null, you can fix your problem.