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. Check if device is online or offline

Hi,

I have hunted around, but can't seem to find an answer to this.  I am
working on an app that will be using local storage through the SQLite
DB, but will also be syncing to a remote server.  If the device is
online, I would like to be able to sync to the remote server, and if
it is offline, I would like to store an event that indicates there is
data to send once the device is online again.  But I can't seem to
find in the API how to query for the current online/offline status of
the device.  Is there something like this available?

Thanks,

Simon

-- 

2. Why ADB Shell no working ?

Dear all,

I want to run a simple shell in ADB, but it doesn't work, can you help me?

[muiz@hp platform-tools]$ *cat c.sh*
*x="hello"
if [ -n "$X" ]; then
echo "hi"
fi*
[muiz@hp platform-tools]$ *adb shell /data/local/c.sh*
1 KB/s (48 bytes in 0.045s)
[muiz@muiz platform-tools]$ *adb shell /data/local/c.sh*
*[: not found*
[muiz@muiz platform-tools]$

Any suggestions ?

*Note: *
1. If I upload the bash file to android, then run this script use command *adb
shell /data/local/bash /data/local/c.sh* works fine, but I don't want to do
this.
2. Same problem with *while* key



Thanks in advanced!

-- 
Regards,
*Muiz*

-- 

3. Drag and Drop

4. This is True / False or a bug!?

5. Launch Fail - Android 3.0 SDK with Eclipse

6. Displaying the Image in the screen center using Canvas

7. Create an Android Layer to support application to run on all the versions