I know about this and it works fine
Intent i1 = new Intent(Login.this, Welcome.class);
i1.putExtra("username","the name");
startActivity(i1);
and this in the next layout:
String username = getIntent().getStringExtra("username");
but i need to tranfer a final string, I tried this but it doesnt work:
public static final String ADMIN_USERNAME= "user";
Intent intent = new Intent(Login.this,SignUp.class);
intent.putExtra("admin_username",ADMIN_USERNAME);
startActivity(intent);
and this in the next layout:
public final String ADMIN_USERNAME= getIntent().getStringExtra("admin_username");
im getting this error:
Attempt to invoke virtual method 'java.lang.String android.content.Intent.getStringExtra(java.lang.String)' on a null object reference