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. Open GL Tutorial problem

Hello Group my name is Claudio Veas and Im having a problem while
trying to execute the tutorial about Android with OPEN GL. The
application consist of two activities one is for selecting the
tutorials and then this activity calls another that according to the
selection of the tutorial, it creates the view that contains the
selected tutorial. The problem is that I have never got to see any of
the tutorials running. I tried debuging and for sure the second
activity is being executed and the right tutorial is selected but when
the application tries to run the constructor of the view this sentence
causes a problem so big that the activity is closed and the
application goes back to the previous one (initial activity) .

package edu.union;

import javax.microedition.khronos.opengles.GL10;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.OpenGLContext;
import android.view.View;

public class GLTutorialOne extends View {
        private OpenGLContext glContext;

        public GLTutorialOne(Context c) {
                super(c);
                glContext = new OpenGLContext(0);
                GL10 gl = (GL10)glContext.getGL();

                gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //<- THIS ONE IS THE 
ONE
THAT SEEMS TO BE  //CAUSEING PROBLEMS
        }

        protected void onDraw(Canvas canvas) {
                GL10 gl = (GL10)glContext.getGL();

                glContext.waitNative();

                gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
        }
}

This is where you can download the tutorial and aparently for what I
have read in some places these tutorials worked fine in M3 version of
the sdk but had some problems in m5  version (I had to make some
changes in my code to make it work). Any Help will be welcome and if
you require more information do not hesitate to ask.

source are in http://code.google.com/p/android-gl/downloads/list

Thanks alot
Claudio Veas

PS: Please excuse my english is not  very good.
--~--~---------~--~----~------------~-------~--~----~

2. TextView Error (ERROR/TextView: Need text Layout but do not have a width)

Hi @all,

what does this Exception means?

Greetz,

Kenny
--~--~---------~--~----~------------~-------~--~----~

3. AndNav - Update

4. Android Tutorial - Option and Context menu

5. Android Tutorial - XML View inflation

6. gallery question

7. Android SDK lacks files in the /tools folder?