How to pass parameters from one activity to another?

deepak - Mon Feb 06 2012 21:43:55 GMT-0500 (EST)

Step 1: Add the Parameters as part of the Intent


Intent intent = new Intent(this, CLASS_NAME.class);
      
intent.putExtra(PARAMETER_NAME, "PARAMETER_VALUE" );
      
startActivity(intent);

deepak - Mon Feb 06 2012 21:59:28 GMT-0500 (EST)

Step 2: Read the Parameters


Bundle extras = getIntent().getExtras();

if(extras != null)
{
   String fromSplash = (String) extras.get(PARAMETER_NAME);
            
}