Quote:
Originally Posted by Rand5
Here's a nice little trick to find the line that is causing the NPE
1. Open the Debug perspective in Eclipse
2. Choose the 'Breakpoints' view tab.
3. Select the 'Add Java Exception Breakpoint' and choose
NullPointerException.
4. Launch your activity, either by using 'Debug As...' or attaching
the debugger to a running instance via DDMS.
5. Execute the offending workflow. It will break on the line that
caused the NPE.
|
Hi,
Thanks for the reply, well I have already done that and I know where the exception is but the problem is I can't resolve it. The problem is on the line where I am fetching the button from the xml. For some reasons it is returning null instead of the button I am referring to.
I verified the name, the button is present in the xml and is been identified by eclipse as well. That means I can read that in the class as it is listed in the R.java. Now every time I run the application I get this null pointer exception. I tried different systems and I tried multiple applications, I guess its only me who is making the mistake and missing something in the process development. Can anyone provide me some help or else sample code that have only single button on the screen which is doing a very small thing...lets say changing the text of a editbox.
Thanks in advance...