-1
I would like to get the email that was typed on the login screen and with this value pass to another Activity.
-1
I would like to get the email that was typed on the login screen and with this value pass to another Activity.
1
If it hasn’t changed since I used it some time ago, you can try with Intent and Bundle.
In class A:
Intent i = new Intent(ClasseA.this, ClasseB.class);
Bundle bundle = new Bundle();
bundle.putString("email", "[email protected]");
i.putExtras(bundle);
startActivity(i);
finish();
In class B:
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
email = getIntent().getExtras().getString("email");
}
Browser other questions tagged android android-studio
You are not signed in. Login or sign up in order to post.
It is signaling the following error in Classeb "'onCreate(Bundle)' is already defined in 'Ep.gismed.gismed.Activity.Home'"
– RoktSe
See if you’ve posted @Override or if you haven’t already declared onCreate.
– HitaloEmanoel
What do I do if onCreate is already declared?
– RoktSe
You put the command email = getIntent().getExt... in what you have already stated. It is just a suggestion, you can put it where you think it best.
– HitaloEmanoel