I'm in an android class project and I have it almost finished but I need to pass some variables from one activity to another, it gives me NullPointerException and looking for I have not found anything.
Logcat
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Bundle android.content.Intent.getExtras ()' on a null object reference at com.grupo3.cebancburger.AnadirHamburguesa. (AddHamburguesa.java:31)
The intent that I do in class.
MainActivity:
(The views)
nomb = (EditText)findViewById(R.id.nombre);
dire = (EditText)findViewById(R.id.direccion);
tele = (EditText)findViewById(R.id.telefono);
email = (EditText)findViewById(R.id.email);
(Intent)
intent = new Intent(DatosCliente.this, AnadirHamburguesa.
intent.putExtra("nombre", nomb.getText().toString());
intent.putExtra("direccion", dire.getText().toString());
intent.putExtra("telefono", tele.getText().toString());
intent.putExtra("email", email.getText().toString());
startActivity(intent);
Add Hamburg (the getIntent)
Bundle extras = getIntent().getExtras();
String nom = extras.getString("nombre");
String dire = extras.getString("direccion");
String tele = extras.getString("telefono");
String email = extras.getString("email");