Android Example Passing Variables Between Activities using Intent

Here is an example of passing variables between activities using Intent. It is easy to add extra inside an intent but unless you do it a lot then you may after reference an example.

Activity Creating the Intent and Starting the other Activity  (Activity1):

   Intent next = new Intent(EditSchedule.this, ConfirmSchedule.class);
   next.putExtra("amount", amountContribute.getText().toString());

Grabbing the variables in the next Activity from Activity1

public class Activity2 extends Activity{

	String duration ="", frequency = "", taxYear = "", amount = "", startDate = "";

	public void onCreate(Bundle savedInstanceState) {

	    Bundle b = getIntent().getExtras();  

            * also you can do:  
            * duration = getIntent().getExtras().getString("duration");

            if(b != null){  // may not be needed in your case
               duration = b.getString("duration");
	       frequency = b.getString("frequency");
               taxYear = b.getString("taxYear");
	       amount = b.getString("amount");
               startDate = b.getString("startDate");

            * also you can do (not tested):  
            * ((TextView) findViewById("duration"));

	    ((TextView) findViewById(;
	    ((TextView) findViewById("??");
	    ((TextView) findViewById(;
	    ((TextView) findViewById(;
	    ((TextView) findViewById(;
	    ((TextView) findViewById(;
	    ((TextView) findViewById(;	    

Graveyard Database Logo

Has everything you want to know about grave yards. Plus has many celebrites and world leaders graves. Pssst it is my other site

Google + Profile
Check out Android Photo Mapping, its a app/site I been working on
  • wholesale nfl jerseys
  • wholesale nfl jerseys china
  • wholesale sports jerseys