I have one activity calling another. But it keeps giving me the error "java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference".
Calling activity:
Intent intent1 = new Intent (this, buisnessProfileEdit.class);
Bundle data1 = new Bundle();
data1.putString("Restaurant Username",restaurantUsername);
startActivity(intent1);
Called activity:
Intent intentReceived = getIntent();
Bundle data = intentReceived.getExtras();
restaurantUsername = data.getString("Restaurant Username");
Can someone help me out why this is happening?