Get variables/controls from event
<p>I'm trying to get some values from a dialog. I have an activity called Splash that shows a dialog with a form. It displays the form wel but i gives me an error when i try to get that values (nullpointer).</p>

<p>I have the folowing code:</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);


    //datos objeto
    nombre = (TextView) findViewById(R.id.tv_nombre);
    padre = (TextView) findViewById(R.id.tv_nom_padre);
    madre = (TextView) findViewById(R.id.tv_nom_madre);
    rgSexo = (RadioGroup) findViewById(R.id.rg_sexo);
    fecha_nac = (DatePicker) findViewById(R.id.dp_fecha_nac);

    rb_m = (RadioButton) findViewById(R.id.rb_masc);
    rb_f = (RadioButton) findViewById(R.id.rb_fem);


    perfil = new PerfilCRUD(this);
    perfil.open();

    //first time
    if (perfil.primeraVez()){
        //muestro el popup
        Log.v(TAG, "prim vez");




        Dialog dialog = new Dialog(this); 
        dialog.setContentView(R.layout.dialog_perfil);
        dialog.setTitle("Datos del usuario");                
        dialog.show();

        Button botOk = (Button) dialog.findViewById(R.id.b_ok);


        botOk.setOnClickListener(new OnClickListener(){
            public void onClick(View v) {

                Log.v(TAG, "boton ok");
                Log.v(TAG, nombre.getText().toString());

            }   
        });
</code></pre>

<p>It gives me the error when i try to get the nombre.getText().toString() value. It happens that with all variables/controls values. It forces to close the application.</p>

<p>Thanks!!</p>
