Using putExtra() and getExtras() in android

Intentsare asynchronous messages which allow Android components to request functionality from other components of the Android system. For example an Activity can send an Intents to the Android system which starts another Activity.

putExtra() adds extended data to the intent.

It has two parameters, first one specifies the name which of the extra data,and the second parameter is the data itself.

getExtra() fetches data which was added using putExtra() in the following way:

Bundle extras= getIntent().getExtras();

Bundle is basically a mapping from String values to various Parcelable types.