Saturday, September 17, 2011

[android-developers] Re: passing objects to pushed activities

Intent intent = new Intent(this, FooActivity.class);
intent.putExra("SomeVariableName", strVariable);
startActivity(intent);


Then in your FooActivity.class (in onCreate(...) for example):
...
Intent intent = getIntent();
String variable = intent.getStringExtra("SomeVariableName");

That's it :)

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate