
It's like a message that Android listens for and then react accordingly by identifying and invoking the app's appropriate component (like an Activity, Service, Content Provider, etc.). It's a way to communicate between Android components to request an action from a component, by different components. An Intent is basically an intention to do an action. Have you ever wondered how a new Activity opens when we click on some button, suppose the settings button to show the Settings screen in any app? How does the app opens up when we click on its notification? How do we get Low battery alert in our mobile? All these things are possible because of Intent in Android.Īn Intent is a messaging object that you can use to request an action from an app component.

Android SDK Manager & required Packages.Lets say I have a list of array (an ArrayList) of a Car class object which is going to be passed through an intent.

More information on parcelable can be seen here.īetter understanding on how to do this technically is by an example. The answers is: “flatten the object into a Parcelable object, passing it into the intent, and rebuild the flatten object into the original object”. So how do we able to pass such kind of custom object data? But Android has no custom object data type that can be passed directly through an intent as in primitive data types. On my previously written article on how to switch between android activities I already explained on how to pass a char sequence variable. Basic primitive data types such as Integer, String, Boolean are easy to be passed through an intent. An intent is an object that is very useful to pass variables between activities in Android.
