SlideShare a Scribd company logo
Prof. Neeraj Bhargava
Vishal Dutt
Department of Computer Science, School of
Engineering & System Sciences
MDS University, Ajmer
What is a list view?
 A ViewGroup that displays scrollable items.
3 Parts of a ListView
 The ListView itself
 aka a ViewGroup
 List items
 Each row/item in the list. Each item is a layout
consisting of a View or ViewGroup.
 Data for each item
ListItem
 Since the ListItem can be a ViewGroup, we have the
power to display very simple or extremely complex
layouts for each item.
 A TextView
 A TextView and ImageView
 A TextView and CheckBox
 A TextView and Button
 A TextView, ImageView, CheckBox, Button, and
RatingBar, etc
Where does the data come from?
 ListViews receive data via Adapters.
 The Adapter behaves as the middleman between the
data source and the ListView.
The job of an Adapter
 The Adapter fetches data from the source.
 Creates the layout that represents each list item.
 Takes the data fetched from the source places it into
the list item layout.
 Returns a list item to the ListView.
How an Adapter Works
Array<String> mMovies = { "Bill and Ted's Excellent Adventures", "Teen
Wolf", "Honey I shrunk the kids", "Texas Chainsaw Massacre",
"Puppet Master" }
Adapter
Bill and Ted’s
Excellent…
Teen Wolf
Honey I shrunk…
Texas Chainsaw
Mas…
Pupper Master
Bill and Ted…
ListView
Data source for Adapters
1. Arrays
2. Content Provider
 Used to get Calendar and Contact info from phone.
3. Database Cursor
Types of Adapters
 ArrayAdapter
 Works with Arrays
 Can handle any Java Object as input
 Uses the .toString() method of the JavaObject to obtain
text for list item.
 SimpleCursorAdapter
 Works with a Content Provider and Database Cursor

More Related Content

What's hot

Excel to excel
Excel to excelExcel to excel
Excel to excel
AccXchange
 
Data types rapid launch (1)
Data types  rapid launch (1)Data types  rapid launch (1)
Data types rapid launch (1)
Alexandra Mannerings
 
Advanced excel topics
Advanced excel topicsAdvanced excel topics
Advanced excel topics
bindur87
 
3 summary
3 summary3 summary
Grade 5 COMPUTER
Grade 5 COMPUTERGrade 5 COMPUTER
Grade 5 COMPUTER
Joel Linquico
 
StatVignette02-Regression.pptx
StatVignette02-Regression.pptxStatVignette02-Regression.pptx
StatVignette02-Regression.pptx
SERC at Carleton College
 
AVL Tree
AVL Tree  AVL Tree
AVL Tree
Ali_Jaan474
 
Join intro
Join introJoin intro
openEHR Clinical Workshop - Implementer perspective
openEHR Clinical Workshop - Implementer perspectiveopenEHR Clinical Workshop - Implementer perspective
openEHR Clinical Workshop - Implementer perspective
Ian McNicoll
 
Princeton's Maximum Entropy Tutorial
Princeton's Maximum Entropy TutorialPrinceton's Maximum Entropy Tutorial
Princeton's Maximum Entropy Tutorial
Dashiell Cruz
 
Agronomy Journal Editorial Board- appointment 2016
Agronomy Journal Editorial Board- appointment 2016Agronomy Journal Editorial Board- appointment 2016
Agronomy Journal Editorial Board- appointment 2016
Jiban Shrestha
 
Spreadsheet advanced functions ppt (2)
Spreadsheet advanced functions ppt (2)Spreadsheet advanced functions ppt (2)
Spreadsheet advanced functions ppt (2)
Tammy Carter
 
REACTOR Overview
REACTOR OverviewREACTOR Overview
REACTOR Overview
mreed111
 
Excle
ExcleExcle
Excle
kamal modi
 
03 - Update an Existing Dataset
03 - Update an Existing Dataset03 - Update an Existing Dataset
03 - Update an Existing Dataset
FENIX Workstation
 
Basics of excel for beginners
Basics of excel for beginnersBasics of excel for beginners
Basics of excel for beginners
Jitesh Khushalani
 
Preparing data for spss analysis
Preparing data for spss analysis Preparing data for spss analysis
Preparing data for spss analysis
Ritika Beria
 
spreadsheet
spreadsheetspreadsheet
Rozalia alik math3 (latest)
Rozalia alik  math3 (latest)Rozalia alik  math3 (latest)
Rozalia alik math3 (latest)
Rozalia Alik
 
Resume
ResumeResume

What's hot (20)

Excel to excel
Excel to excelExcel to excel
Excel to excel
 
Data types rapid launch (1)
Data types  rapid launch (1)Data types  rapid launch (1)
Data types rapid launch (1)
 
Advanced excel topics
Advanced excel topicsAdvanced excel topics
Advanced excel topics
 
3 summary
3 summary3 summary
3 summary
 
Grade 5 COMPUTER
Grade 5 COMPUTERGrade 5 COMPUTER
Grade 5 COMPUTER
 
StatVignette02-Regression.pptx
StatVignette02-Regression.pptxStatVignette02-Regression.pptx
StatVignette02-Regression.pptx
 
AVL Tree
AVL Tree  AVL Tree
AVL Tree
 
Join intro
Join introJoin intro
Join intro
 
openEHR Clinical Workshop - Implementer perspective
openEHR Clinical Workshop - Implementer perspectiveopenEHR Clinical Workshop - Implementer perspective
openEHR Clinical Workshop - Implementer perspective
 
Princeton's Maximum Entropy Tutorial
Princeton's Maximum Entropy TutorialPrinceton's Maximum Entropy Tutorial
Princeton's Maximum Entropy Tutorial
 
Agronomy Journal Editorial Board- appointment 2016
Agronomy Journal Editorial Board- appointment 2016Agronomy Journal Editorial Board- appointment 2016
Agronomy Journal Editorial Board- appointment 2016
 
Spreadsheet advanced functions ppt (2)
Spreadsheet advanced functions ppt (2)Spreadsheet advanced functions ppt (2)
Spreadsheet advanced functions ppt (2)
 
REACTOR Overview
REACTOR OverviewREACTOR Overview
REACTOR Overview
 
Excle
ExcleExcle
Excle
 
03 - Update an Existing Dataset
03 - Update an Existing Dataset03 - Update an Existing Dataset
03 - Update an Existing Dataset
 
Basics of excel for beginners
Basics of excel for beginnersBasics of excel for beginners
Basics of excel for beginners
 
Preparing data for spss analysis
Preparing data for spss analysis Preparing data for spss analysis
Preparing data for spss analysis
 
spreadsheet
spreadsheetspreadsheet
spreadsheet
 
Rozalia alik math3 (latest)
Rozalia alik  math3 (latest)Rozalia alik  math3 (latest)
Rozalia alik math3 (latest)
 
Resume
ResumeResume
Resume
 

Similar to List view1

Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)
Khaled Anaqwa
 
Android adapters
Android adaptersAndroid adapters
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
Tutort Academy
 
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
SivaSankar Gorantla
 
PROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITY
PROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITYPROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITY
PROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITY
IAEME Publication
 
Android list view tutorial by Javatechig
Android list view tutorial by JavatechigAndroid list view tutorial by Javatechig
Android list view tutorial by Javatechig
Javatechig Resources for Developers
 
oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collection
ssuseredfbe9
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
Adams Sidibe
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
meenamadhuvandhi2
 
Nature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptxNature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptx
IllllBikkySharmaIlll
 
A NEW ASSOCIATION RULE MINING BASED ON FREQUENT ITEM SET
A NEW ASSOCIATION RULE MINING BASED  ON FREQUENT ITEM SETA NEW ASSOCIATION RULE MINING BASED  ON FREQUENT ITEM SET
A NEW ASSOCIATION RULE MINING BASED ON FREQUENT ITEM SET
cscpconf
 
List view3
List view3List view3
List view3
Vishal Dutt
 
Applied systems 1 vocabulary
Applied systems 1 vocabularyApplied systems 1 vocabulary
Applied systems 1 vocabulary
Paola Rincón
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
Rajitha Reddy Alugati
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_types
Andres Mendez-Vazquez
 
Introduction to Data Structures .
Introduction to Data Structures        .Introduction to Data Structures        .
Introduction to Data Structures .
Ashutosh Satapathy
 
ppt on arrays in c programming language.pptx
ppt on arrays in c programming language.pptxppt on arrays in c programming language.pptx
ppt on arrays in c programming language.pptx
AmanRai352102
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
PraveenKumar977108
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Malikireddy Bramhananda Reddy
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Axmedcarb
 

Similar to List view1 (20)

Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)Android Training (AdapterView & Adapter)
Android Training (AdapterView & Adapter)
 
Android adapters
Android adaptersAndroid adapters
Android adapters
 
Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...Which data structure is it? What are the various data structure kinds and wha...
Which data structure is it? What are the various data structure kinds and wha...
 
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
 
PROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITY
PROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITYPROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITY
PROFIT AGENT CLASSIFICATION USING FEATURE SELECTION EIGENVECTOR CENTRALITY
 
Android list view tutorial by Javatechig
Android list view tutorial by JavatechigAndroid list view tutorial by Javatechig
Android list view tutorial by Javatechig
 
oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collection
 
DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
 
UNITIII LDS.pdf
UNITIII LDS.pdfUNITIII LDS.pdf
UNITIII LDS.pdf
 
Nature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptxNature Activities Binder _ by Slidesgo.pptx
Nature Activities Binder _ by Slidesgo.pptx
 
A NEW ASSOCIATION RULE MINING BASED ON FREQUENT ITEM SET
A NEW ASSOCIATION RULE MINING BASED  ON FREQUENT ITEM SETA NEW ASSOCIATION RULE MINING BASED  ON FREQUENT ITEM SET
A NEW ASSOCIATION RULE MINING BASED ON FREQUENT ITEM SET
 
List view3
List view3List view3
List view3
 
Applied systems 1 vocabulary
Applied systems 1 vocabularyApplied systems 1 vocabulary
Applied systems 1 vocabulary
 
TSAT Presentation1.pptx
TSAT Presentation1.pptxTSAT Presentation1.pptx
TSAT Presentation1.pptx
 
Preparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_typesPreparation Data Structures 03 abstract data_types
Preparation Data Structures 03 abstract data_types
 
Introduction to Data Structures .
Introduction to Data Structures        .Introduction to Data Structures        .
Introduction to Data Structures .
 
ppt on arrays in c programming language.pptx
ppt on arrays in c programming language.pptxppt on arrays in c programming language.pptx
ppt on arrays in c programming language.pptx
 
1597380885789.ppt
1597380885789.ppt1597380885789.ppt
1597380885789.ppt
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 
Chapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdfChapter 1 Introduction to Data Structures and Algorithms.pdf
Chapter 1 Introduction to Data Structures and Algorithms.pdf
 

More from Vishal Dutt

Grid computing components
Grid computing componentsGrid computing components
Grid computing components
Vishal Dutt
 
Python files / directories part16
Python files / directories  part16Python files / directories  part16
Python files / directories part16
Vishal Dutt
 
Python Classes and Objects part14
Python Classes and Objects  part14Python Classes and Objects  part14
Python Classes and Objects part14
Vishal Dutt
 
Python Classes and Objects part13
Python Classes and Objects  part13Python Classes and Objects  part13
Python Classes and Objects part13
Vishal Dutt
 
Python files / directories part15
Python files / directories  part15Python files / directories  part15
Python files / directories part15
Vishal Dutt
 
Python functions part12
Python functions  part12Python functions  part12
Python functions part12
Vishal Dutt
 
Python functions part11
Python functions  part11Python functions  part11
Python functions part11
Vishal Dutt
 
Python functions part10
Python functions  part10Python functions  part10
Python functions part10
Vishal Dutt
 
List view5
List view5List view5
List view5
Vishal Dutt
 
Python decision making_loops_control statements part9
Python decision making_loops_control statements part9Python decision making_loops_control statements part9
Python decision making_loops_control statements part9
Vishal Dutt
 
List view4
List view4List view4
List view4
Vishal Dutt
 
Python decision making_loops_control statements part8
Python decision making_loops_control statements part8Python decision making_loops_control statements part8
Python decision making_loops_control statements part8
Vishal Dutt
 
Python decision making_loops part7
Python decision making_loops part7Python decision making_loops part7
Python decision making_loops part7
Vishal Dutt
 
Python decision making_loops part6
Python decision making_loops part6Python decision making_loops part6
Python decision making_loops part6
Vishal Dutt
 
List view2
List view2List view2
List view2
Vishal Dutt
 
Python decision making part5
Python decision making part5Python decision making part5
Python decision making part5
Vishal Dutt
 
Python decision making part4
Python decision making part4Python decision making part4
Python decision making part4
Vishal Dutt
 
Python operators part3
Python operators part3Python operators part3
Python operators part3
Vishal Dutt
 
Python operators part2
Python operators part2Python operators part2
Python operators part2
Vishal Dutt
 
Python part1
Python part1Python part1
Python part1
Vishal Dutt
 

More from Vishal Dutt (20)

Grid computing components
Grid computing componentsGrid computing components
Grid computing components
 
Python files / directories part16
Python files / directories  part16Python files / directories  part16
Python files / directories part16
 
Python Classes and Objects part14
Python Classes and Objects  part14Python Classes and Objects  part14
Python Classes and Objects part14
 
Python Classes and Objects part13
Python Classes and Objects  part13Python Classes and Objects  part13
Python Classes and Objects part13
 
Python files / directories part15
Python files / directories  part15Python files / directories  part15
Python files / directories part15
 
Python functions part12
Python functions  part12Python functions  part12
Python functions part12
 
Python functions part11
Python functions  part11Python functions  part11
Python functions part11
 
Python functions part10
Python functions  part10Python functions  part10
Python functions part10
 
List view5
List view5List view5
List view5
 
Python decision making_loops_control statements part9
Python decision making_loops_control statements part9Python decision making_loops_control statements part9
Python decision making_loops_control statements part9
 
List view4
List view4List view4
List view4
 
Python decision making_loops_control statements part8
Python decision making_loops_control statements part8Python decision making_loops_control statements part8
Python decision making_loops_control statements part8
 
Python decision making_loops part7
Python decision making_loops part7Python decision making_loops part7
Python decision making_loops part7
 
Python decision making_loops part6
Python decision making_loops part6Python decision making_loops part6
Python decision making_loops part6
 
List view2
List view2List view2
List view2
 
Python decision making part5
Python decision making part5Python decision making part5
Python decision making part5
 
Python decision making part4
Python decision making part4Python decision making part4
Python decision making part4
 
Python operators part3
Python operators part3Python operators part3
Python operators part3
 
Python operators part2
Python operators part2Python operators part2
Python operators part2
 
Python part1
Python part1Python part1
Python part1
 

Recently uploaded

math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
spdendr
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
Amin Marwan
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 

Recently uploaded (20)

math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
Solutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptxSolutons Maths Escape Room Spatial .pptx
Solutons Maths Escape Room Spatial .pptx
 
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdfIGCSE Biology Chapter 14- Reproduction in Plants.pdf
IGCSE Biology Chapter 14- Reproduction in Plants.pdf
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 

List view1

  • 1. Prof. Neeraj Bhargava Vishal Dutt Department of Computer Science, School of Engineering & System Sciences MDS University, Ajmer
  • 2. What is a list view?  A ViewGroup that displays scrollable items.
  • 3. 3 Parts of a ListView  The ListView itself  aka a ViewGroup  List items  Each row/item in the list. Each item is a layout consisting of a View or ViewGroup.  Data for each item
  • 4. ListItem  Since the ListItem can be a ViewGroup, we have the power to display very simple or extremely complex layouts for each item.  A TextView  A TextView and ImageView  A TextView and CheckBox  A TextView and Button  A TextView, ImageView, CheckBox, Button, and RatingBar, etc
  • 5. Where does the data come from?  ListViews receive data via Adapters.  The Adapter behaves as the middleman between the data source and the ListView.
  • 6. The job of an Adapter  The Adapter fetches data from the source.  Creates the layout that represents each list item.  Takes the data fetched from the source places it into the list item layout.  Returns a list item to the ListView.
  • 7. How an Adapter Works Array<String> mMovies = { "Bill and Ted's Excellent Adventures", "Teen Wolf", "Honey I shrunk the kids", "Texas Chainsaw Massacre", "Puppet Master" } Adapter Bill and Ted’s Excellent… Teen Wolf Honey I shrunk… Texas Chainsaw Mas… Pupper Master Bill and Ted… ListView
  • 8. Data source for Adapters 1. Arrays 2. Content Provider  Used to get Calendar and Contact info from phone. 3. Database Cursor
  • 9. Types of Adapters  ArrayAdapter  Works with Arrays  Can handle any Java Object as input  Uses the .toString() method of the JavaObject to obtain text for list item.  SimpleCursorAdapter  Works with a Content Provider and Database Cursor