Android: Not receiving the extra intent ID -
hi i'm trying send data textview activity in destination activity doesn't pick intent data id. clarify, in destination activity not recognize variable "username" . how fix this?
mainactivity activity (sender)
public final static string username = "com.example.eugen.test.mainactivity.etusername"; intent destination_intent = new intent(this, destination.class); destination_intent.putextra(username,etusername.gettext()); startactivity(destination_intent);
destination activity
string usernamereceived = null; usernamereceived = getintent().getstringextra(destination.username);
just change destination.username
mainactivity.username
variable username
declared static
in mainactivity
. , ivan v suggested, practice create constants
file , declare static
constants
there, make things more cleaner.
Comments
Post a Comment