Use intent.putExtra(key, value) in your 1st activity and access them
using getIntent().getExtras() in the 2nd
On Mar 3, 12:21 am, Kofa elk...@gmail.com wrote:
I'm trying to read a variable from one activity to another... i
explain better: I'm making a video game, so the user will have to
chose
U can use bundle also in passing that variable values.
In 1st activity
Bundle bundle = new Bundle();
bundle.putString(”param1″, “test”);
Intent newIntent = new Intent(this.getApplicationContext(),
ActivityClass2.class);
newIntent.putExtras(bundle);
So are you talking about like a Setup activity, where you choose those
things, and then when you're done it launches the game?
If that's what you're talking about, you would create the second
activity and pass the config options to it at creation.
3 matches
Mail list logo