What is Intent?
An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcast Intent to send it to any interested Broadcast Receiver components, and start Service(Intent) or bind Service(Intent, Service Connection, int) to communicate with a background Service
Intents are asynchronous messages which allow application components to request functionality from other Android components. Intents allow you to interact with components from the same applications as well as with components contributed by other applications.
The meaning of intent is intention or purpose… so, it can be described as intention to do action, it is the subclass of android.content.Intent class.
Intents mainly used to :
launch an activity, start a service, display list of contacts etc.., two types of intents available: Implicit intent and explicit intent
Implicit intent doesn’t specify the component, example
Intent intent=new Intent(Intent.ACTION_VIEW);
for this, we should take internet permission in manifest file…
Intent i = new Intent(getApplicationContext(), ActivityTwo.class);
here, we specify ActivityTwo class in manifest file..
Above examples are very basics in intents ..
we can send data from one activity to another activity by using bundle….