Moving Data between Intents in Android

Being working on android from past few months the most attracting feature it provides is about activities and intents. Intents play a major role wheter you have to make a primitive screen to screen workflow of your application or if you have to combine various different activities or tasks (defined as different classes) together.

In the calling Activity;

Intent intent = new Intent ( the calling activity class.this,to be called activity.class );
intent.putExtra( the calling activity class.data , the calling activity class.data );
startActivity(intent);

// Keeping the variable data static would keep less room for bugs and errors

In the called Activity, you have to catch the data.

Bundle extras= getIntent().getExtras();
DataType  data= extras.getString(the calling activity class.data);


About this entry



About The Author