x
Menu

Android For Beginners

Other,

Updated On 02 Feb, 19

Overview

Includes

Lecture 6: Intents, Intent Types (Part - 6)

4.1 ( 11 )


Lecture Details

Join us and Take a FREE Webinar on Android httpwww.edureka.coandroid-development-certification-course

This android tutorial talks about Intents in detail
Read more about Android Intent at

httpwww.edureka.coblogandroid-tutorials-intent-component

Android Intent Details
--------------------------------

Intents can be simply defined as synchronous messages by which one Android Component can request functionality of other component.
An intent can even open a web-browser for you. Any activity can send an intent by which new activity can be started.

Sample code -
Intent intent = new Intent(MainActivity.this, SecondActivity.class);
startActivity(intent);

Suppose on your Facebook Account you are on the news feed screen (which is one Activity), and want to view a pic posted by our friend. When you click on the photo, the intent associated with the click event of photo is fired which communicates the message, and the Photo page opens (which is a new Activity).


Think of intent as a message to communicate an action. It is a description of what you want done, example VIEW VIDEO, PLAY GAME etc.

They are commands which when called would act as communicators between the three core components of Android, i.e. Activities, Services and Broadcast Receivers.

While you are interacting with one activity, you might want to switch to another one; this is done by defining a proper Intent for the action. Here one Activity uses Intent to request the launch of another Activity. Thus, it is evident that using intents, one Android component can request action from the other components of Android.

Intent Types
-----------------

Delving further, Intents can be Explicit or Implicit.

----Explicit Intent

An Explicit Intent is exactly what it means literally an "explicit intention" to perform an action. Simply put, in this case, we define explicitly the Android component (Activity, Service or Broadcast Receiver) that needs calling.

----Implicit Intent

Here we do not specifically define the component that needs to be called. However, the Intent contains enough information to direct the system to fetch the correct one.

-------------------------------------------------------------------------
Please write back to us at support@edureka.in or call us at +91-8880862004 for more information.
httpwww.edureka.co

Use the link to watch all videos of this session
httpwww.youtube.complaylist?list=PL9ooVrP1hQOHiWL2R-gYcF8oA4yPJKTNb

Ratings

0


0 Ratings
55%
30%
10%
3%
2%
Comments
comment person image

Sam

Excellent course helped me understand topic that i couldn't while attendinfg my college.

Reply
comment person image

Dembe

Great course. Thank you very much.

Reply
Send