You can use Intent.putExtra (which uses the Bundle ) to transfer additional data.
Intent i = new Intent(this, Class2.class); i.putExtra("foo", 5.0f); i.putExtra("bar", "baz"); startActivity(i);
Then, when you enter the new Activity :
Bundle extras = getIntent().getExtras(); if(extras !=null) { float foo = extras.getFloat("foo"); String bar = extras.getString("bar"); }
This allows you to transfer basic data to the "Activity". However, you may need a little more work to pass arbitrary objects.
Joshua rodgers
source share