SlideShare a Scribd company logo
Intents
By
Sharmilee
Java Trainer
Mazenet Solution
• Intents are asynchronous messages
• It allow you to interact with components
• Types of Intent
– Implicit Intent
– Explicit Intent
Android - Intents - Mazenet Solution
Starting Activities
• To start an activity, use the method
startActivity(intent)
• This method is defined on the Context object
which Activity extends.
Android - Intents - Mazenet Solution
• Activities which are started by other Android
activities are called sub-activities.
Intent i = new Intent(this, ActivityTwo.class);
startActivity(i);
Types of Intent
1. Explicit Intents
Explicit Intents
• It explicitly define the component which
should be called by the Android system, by
using the Java class as identifier.
Intent i = new Intent(this, ActivityTwo.class);
i.putExtra("Value1", "This value one for ActivityTwo ");
i.putExtra("Value2", "This value two ActivityTwo");
2. Implicit Intents
Implicit Intents
• Implicit intents specify the action which
should be performed and optionally data
which provides content for the action.
• For Example: the following tells the Android
System to view a web page.
Intent i = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.mazenetsolution.com"));
startActivity(i);
Retrieving result data from a sub-activity
Android - Intents - Mazenet Solution
Android - Intents - Mazenet Solution
Example
startActivityForResult()
public void onClick(View view)
{
Intent i = new Intent(this, ActivityTwo.class);
i.putExtra("Value1", "This value one for ActivityTwo ");
i.putExtra("Value2", "This value two ActivityTwo");
startActivityForResult(i, REQUEST_CODE);
}
Intent Filter
• Intents are used to signal to the Android
system that a certain event has occurred.
• Intents often describe the action which should
be performed and provide data upon which
such an action should be done.
String url = "http://www.mazenetsolution.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
Example: Register an activity as
browser
<activity android:name=".BrowserActivitiy"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http"/>
</intent-filter>
</activity>
Nungambakkam, Chennai
Website: www.mazenetsolution.com
www.mazenet-chennai.in
Mobile : 9677718889

More Related Content

What's hot (12)

PDF
07 intent
Anuchit Chalothorn
 
PPTX
Observer pattern
Shahriar Iqbal Chowdhury
 
PPT
Java eventhandling
Arati Gadgil
 
PPTX
When life gives you functions make functional programs!
Aaron Levin
 
DOCX
Dr Jammi Ashok - Introduction to Java Material (OOPs)
jammiashok123
 
PPTX
Event handling in Java(part 1)
RAJITHARAMACHANDRAN1
 
PPTX
Event handling in Java(part 2)
RAJITHARAMACHANDRAN1
 
PPTX
Event Handling in JAVA
Srajan Shukla
 
PPTX
Event Handling in java
Google
 
DOCX
Ordenar vector
ecasteloc
 
PDF
Automatic generation of event summaries using microblog streams
Kaushalya Madhawa
 
Observer pattern
Shahriar Iqbal Chowdhury
 
Java eventhandling
Arati Gadgil
 
When life gives you functions make functional programs!
Aaron Levin
 
Dr Jammi Ashok - Introduction to Java Material (OOPs)
jammiashok123
 
Event handling in Java(part 1)
RAJITHARAMACHANDRAN1
 
Event handling in Java(part 2)
RAJITHARAMACHANDRAN1
 
Event Handling in JAVA
Srajan Shukla
 
Event Handling in java
Google
 
Ordenar vector
ecasteloc
 
Automatic generation of event summaries using microblog streams
Kaushalya Madhawa
 

Viewers also liked (20)

PPTX
Android intents, notification and broadcast recievers
Utkarsh Mankad
 
PDF
Android App Development 07 : Intent &amp; Share
Anuchit Chalothorn
 
PPT
Level 1 &amp; 2
skumartarget
 
PDF
Intents are Awesome
Israel Camacho
 
PPT
Static testing techniques
Mazenetsolution
 
ODP
Android App Development - 07 Threading
Diego Grancini
 
PPTX
Android async task
Madhu Venkat
 
PPTX
Android Dialogs Tutorial
Perfect APK
 
PPTX
Android service, aidl - day 1
Utkarsh Mankad
 
PDF
Deep dive into android restoration - DroidCon Paris 2014
Paris Android User Group
 
PPTX
Android Activity Transition(ShareElement)
Ted Liang
 
PPTX
Thread management
Ayaan Adeel
 
PPT
Lecture Slides for Preferences and Menus [Android ]
Nehil Jain
 
PDF
Android service
Kirill Rozov
 
PDF
Android Threading
Jussi Pohjolainen
 
PDF
AndroidManifest
Ahsanul Karim
 
PDF
Intents in Android
ma-polimi
 
PPT
Android - Thread, Handler and AsyncTask
Hoang Ngo
 
PPT
Test Levels & Techniques
Dhanasekaran Nagarajan
 
PPTX
Efficient Android Threading
Anders Göransson
 
Android intents, notification and broadcast recievers
Utkarsh Mankad
 
Android App Development 07 : Intent &amp; Share
Anuchit Chalothorn
 
Level 1 &amp; 2
skumartarget
 
Intents are Awesome
Israel Camacho
 
Static testing techniques
Mazenetsolution
 
Android App Development - 07 Threading
Diego Grancini
 
Android async task
Madhu Venkat
 
Android Dialogs Tutorial
Perfect APK
 
Android service, aidl - day 1
Utkarsh Mankad
 
Deep dive into android restoration - DroidCon Paris 2014
Paris Android User Group
 
Android Activity Transition(ShareElement)
Ted Liang
 
Thread management
Ayaan Adeel
 
Lecture Slides for Preferences and Menus [Android ]
Nehil Jain
 
Android service
Kirill Rozov
 
Android Threading
Jussi Pohjolainen
 
AndroidManifest
Ahsanul Karim
 
Intents in Android
ma-polimi
 
Android - Thread, Handler and AsyncTask
Hoang Ngo
 
Test Levels & Techniques
Dhanasekaran Nagarajan
 
Efficient Android Threading
Anders Göransson
 
Ad

Similar to Android - Intents - Mazenet Solution (20)

PPTX
Android activity intentsq
perpetrotech
 
PPTX
Android activity intents
perpetrotech
 
PPTX
Android webinar class_3
Edureka!
 
DOCX
Android intents in android application-chapter7
Dr. Ramkumar Lakshminarayanan
 
PPTX
unit3.pptx
sunilsoni446112
 
PPT
ANDROID
DrMeftahZouai
 
PPTX
Activity & Shared Preference
nationalmobileapps
 
PPT
Intent, Service and BroadcastReciver (2).ppt
BirukMarkos
 
PPTX
Data Transfer between Activities & Databases
Muhammad Sajid
 
PPT
Day 4: Android: Getting Active through Activities
Ahsanul Karim
 
ODP
Android App Development - 02 Activity and intent
Diego Grancini
 
PDF
Lab1-android
Lilia Sfaxi
 
PPTX
Android application development
Mayank Bhatt
 
PPTX
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
MugiiiReee
 
PPTX
Data Transfer between activities and Database
faiz324545
 
PPTX
Unit 5 Activity and Activity Life Cycle.pptx
ShantanuDharekar
 
PDF
Ch5 intent broadcast receivers adapters and internet
Shih-Hsiang Lin
 
PPTX
Pertemuan 03 - Activities and intents.pptx
MUHAMMADRIFKIPERMANA2
 
DOCX
Using intents in android
Oum Saokosal
 
PDF
Java unit 7
Shipra Swati
 
Android activity intentsq
perpetrotech
 
Android activity intents
perpetrotech
 
Android webinar class_3
Edureka!
 
Android intents in android application-chapter7
Dr. Ramkumar Lakshminarayanan
 
unit3.pptx
sunilsoni446112
 
ANDROID
DrMeftahZouai
 
Activity & Shared Preference
nationalmobileapps
 
Intent, Service and BroadcastReciver (2).ppt
BirukMarkos
 
Data Transfer between Activities & Databases
Muhammad Sajid
 
Day 4: Android: Getting Active through Activities
Ahsanul Karim
 
Android App Development - 02 Activity and intent
Diego Grancini
 
Lab1-android
Lilia Sfaxi
 
Android application development
Mayank Bhatt
 
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptx
MugiiiReee
 
Data Transfer between activities and Database
faiz324545
 
Unit 5 Activity and Activity Life Cycle.pptx
ShantanuDharekar
 
Ch5 intent broadcast receivers adapters and internet
Shih-Hsiang Lin
 
Pertemuan 03 - Activities and intents.pptx
MUHAMMADRIFKIPERMANA2
 
Using intents in android
Oum Saokosal
 
Java unit 7
Shipra Swati
 
Ad

More from Mazenetsolution (20)

PPTX
Tally Auto E-mail Module | Mazenet Technologies
Mazenetsolution
 
PPTX
Tally Auto SMS Module| Mazenet Technologies
Mazenetsolution
 
PPTX
Tally auto synchronization
Mazenetsolution
 
PPTX
Print barcode using voucher- Mazenettechnologies
Mazenetsolution
 
PPTX
Copy user list | Tally | Tally Software | Accounting Software | Mazenet
Mazenetsolution
 
PPTX
Auto synchronization | Tally Software | Mazenet Technologies
Mazenetsolution
 
PPTX
Auto backup | Tally Coimbatore | Tally Software
Mazenetsolution
 
PPTX
Mazenet Technologies-Tally
Mazenetsolution
 
PPT
Java - Servlet - Mazenet Solution
Mazenetsolution
 
PPT
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Mazenetsolution
 
PPT
Software Testing - Test management - Mazenet Solution
Mazenetsolution
 
PPTX
Red Hat - LVM - Mazenet Solution
Mazenetsolution
 
PPT
PHP - Introduction to PHP - Mazenet Solution
Mazenetsolution
 
PPTX
Java- GUI- Mazenet solution
Mazenetsolution
 
PPT
Oracle- Introduction to Sql commands- Mazenet solution
Mazenetsolution
 
PPTX
Process management in linux
Mazenetsolution
 
PPT
Software Testing- Principles of testing- Mazenet Solution
Mazenetsolution
 
PPTX
Java- JDBC- Mazenet Solution
Mazenetsolution
 
PPT
Software Testing-Dynamic testing technique-Mazenet solution
Mazenetsolution
 
PPTX
Java- Updates in java8-Mazenet solution
Mazenetsolution
 
Tally Auto E-mail Module | Mazenet Technologies
Mazenetsolution
 
Tally Auto SMS Module| Mazenet Technologies
Mazenetsolution
 
Tally auto synchronization
Mazenetsolution
 
Print barcode using voucher- Mazenettechnologies
Mazenetsolution
 
Copy user list | Tally | Tally Software | Accounting Software | Mazenet
Mazenetsolution
 
Auto synchronization | Tally Software | Mazenet Technologies
Mazenetsolution
 
Auto backup | Tally Coimbatore | Tally Software
Mazenetsolution
 
Mazenet Technologies-Tally
Mazenetsolution
 
Java - Servlet - Mazenet Solution
Mazenetsolution
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Mazenetsolution
 
Software Testing - Test management - Mazenet Solution
Mazenetsolution
 
Red Hat - LVM - Mazenet Solution
Mazenetsolution
 
PHP - Introduction to PHP - Mazenet Solution
Mazenetsolution
 
Java- GUI- Mazenet solution
Mazenetsolution
 
Oracle- Introduction to Sql commands- Mazenet solution
Mazenetsolution
 
Process management in linux
Mazenetsolution
 
Software Testing- Principles of testing- Mazenet Solution
Mazenetsolution
 
Java- JDBC- Mazenet Solution
Mazenetsolution
 
Software Testing-Dynamic testing technique-Mazenet solution
Mazenetsolution
 
Java- Updates in java8-Mazenet solution
Mazenetsolution
 

Recently uploaded (20)

PDF
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PDF
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
BÀI TẬP BỔ TRỢ THEO LESSON TIẾNG ANH - I-LEARN SMART WORLD 7 - CẢ NĂM - CÓ ĐÁ...
Nguyen Thanh Tu Collection
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
CHILD RIGHTS AND PROTECTION QUESTION BANK
Dr Raja Mohammed T
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
'' IMPORTANCE OF EXCLUSIVE BREAST FEEDING ''
SHAHEEN SHAIKH
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
Views on Education of Indian Thinkers J.Krishnamurthy..pptx
ShrutiMahanta1
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
community health nursing question paper 2.pdf
Prince kumar
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 

Android - Intents - Mazenet Solution

  • 2. • Intents are asynchronous messages • It allow you to interact with components • Types of Intent – Implicit Intent – Explicit Intent
  • 4. Starting Activities • To start an activity, use the method startActivity(intent) • This method is defined on the Context object which Activity extends.
  • 6. • Activities which are started by other Android activities are called sub-activities. Intent i = new Intent(this, ActivityTwo.class); startActivity(i);
  • 9. Explicit Intents • It explicitly define the component which should be called by the Android system, by using the Java class as identifier. Intent i = new Intent(this, ActivityTwo.class); i.putExtra("Value1", "This value one for ActivityTwo "); i.putExtra("Value2", "This value two ActivityTwo");
  • 11. Implicit Intents • Implicit intents specify the action which should be performed and optionally data which provides content for the action. • For Example: the following tells the Android System to view a web page. Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.mazenetsolution.com")); startActivity(i);
  • 12. Retrieving result data from a sub-activity
  • 16. startActivityForResult() public void onClick(View view) { Intent i = new Intent(this, ActivityTwo.class); i.putExtra("Value1", "This value one for ActivityTwo "); i.putExtra("Value2", "This value two ActivityTwo"); startActivityForResult(i, REQUEST_CODE); }
  • 18. • Intents are used to signal to the Android system that a certain event has occurred. • Intents often describe the action which should be performed and provide data upon which such an action should be done.
  • 19. String url = "http://www.mazenetsolution.com"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i);
  • 20. Example: Register an activity as browser <activity android:name=".BrowserActivitiy" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:scheme="http"/> </intent-filter> </activity>