Null Pointer Exception on accessing value of EditText

by Ankur Kumar » Fri, 20 May 2011 09:30:39 GMT


Sponsored Links
 Hello Developers,

Please help me with this problem. I am getting
java.lang.NullPointerException at step 3 in my code. Have not been
able to figure this out. The value I am entering in the EditText is
not empty.

                       1.  EditText IPInput = (EditText)
findViewById(R.id.ip);
                       2.  IPInput.getText().toString(); System.out.println(ip);
                       3.  System.out.println(IPInput.getText().toString());

--
Regards,
Ankur Kumar

-- 



Null Pointer Exception on accessing value of EditText

by Ankur Kumar » Fri, 20 May 2011 09:30:40 GMT


 Hello Developers,

Please help me with this problem. I am getting*java.lang.NullPointerException
* at step 3 in my code. Have not been able to figure this out. The value I
am entering in the EditText is not empty.

                       1.  EditText IPInput = (EditText)
findViewById(R.id.ip);
       2.  IPInput.getText().toString(); System.out.println(ip);
        3.  System.out.println(IPInput.getText().toString());



--
Regards,
Ankur Kumar

-- 


Sponsored Links


Other Threads

1. Hierarchy Viewer in landscape orientation

Is there a trick to getting the Hierarchy Viewer to work in landscape
orientation, or is it completely broken?  In Pixel Perfect View it
shows my screen sideways (i.e. in portrait aspect ratio), but when I
click on the views in the explorer area it outlines the wrong areas of
the screen.  It looks like the outlining assumes the display is in
landscape orientation, so it outlines where the views would be if it
were oriented correctly.  Obviously fixing the display would be the
best solution, but barring that I'm OK tilting my head if only the
outlining would agree with the display.  Anyone know a way around
this?

-- Peter

--~--~---------~--~----~------------~-------~--~----~

2. flag_fullscreen + windowNoTitle == button focus bug

Hmm. Well, sounds like you are describing a race condition in the platform.

All our activities are theme 
"@android:style/Theme.Black.NoTitleBar.Fullscreen" and they still 
wiggled, so that's not enough to close the window.

Perhaps in our case, we make it happen because on being foregrounded 
we switch to another activity in onCreate(), and whatever "optimized" 
path is taken in that case reliably causes the situation you describe.

Not a problem in 1.0, 1.1 BTW.

-- Ward










> <

3. Linking to apps in the Android Market

4. Using Intent to view specific App in Android Market

5. how to add the sd8686 wifi driver (libertas) into android source code for compling

6. ADC2 full terms and conditions

7. Able to use T-Mobile G1 without contract for application testing?