Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Fragments: What are they good for?
Search
David Hope
July 29, 2016
Technology
21k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Fragments: What are they good for?
Fragments: What are they good for? Talk given at 360AnDev 2016 on July 28th, 2016
#360andev
David Hope
July 29, 2016
Other Decks in Technology
See All in Technology
You Have Agency(サンキュー、Ruby)
snoozer05
PRO
5
660
2026 Apache Flink Community Checkpoint
rmetzger
0
120
Deep Data Security 機能解説
oracle4engineer
PRO
3
1k
Devin プロモコードの受け取りと適用(2026.10.27)
kinopeee
1
840
eBPF 簡介 2026 版
shunghsiyu
0
160
20261031_IoTLT_vol140_kitazaki_v1.pdf
kitazaki
0
160
リアクションエンジニア ― 小さなリアクションから、話しかけやすい組織をつくる ―
ryuguyana
1
120
AI秘書と毎日働くのはもう当たり前。開発以外の業務に足りない機能をどう埋める?
minorun365
PRO
4
2.2k
Oracle Database Security 詳細解説
oracle4engineer
PRO
1
240
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
120
現場を動かすAIエージェント#2_製造業現場でのAI活用から見た、ハマる罠と実践知
kintotechdev
1
130
新卒エンジニア、 介護士になる
ryu1013
1
680
Featured
See All Featured
Crafting Experiences
bethany
1
410
Done Done
chrislema
187
17k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
490
Designing for humans not robots
tammielis
254
26k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
560
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
How to Talk to Developers About Accessibility
jct
2
610
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
500
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
760
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Transcript
Fragments: WHAT ARE THEY GOOD FOR?
None
None
Overview u Why Fragments? u Different types u Anatomy u
Lifecycle u How to use u Common Usage u Best Practices
None
None
Types of Fragments
None
None
Static Fragment Example
Dynamic Fragments
Dynamic Fragment u Require Container u Framework u Support
Framework Fragments
Support Fragments
None
Fragment Lifecycle
None
None
None
None
onAttach ( )
onAttach( ) Example
onCreateView ( )
onCreateView( ) Example
onCreateView( ) Fixes u View – Hold Parameters u Inflater
– Add Layout u View Container – Collection for Views u Bundle –Reconstructs Fragment
onActivityCreated( )
onActivityCreated( ) Example
Standard Lifecycle ( )’s u onStart( ) u onResume( )
u onPause( )
onDestroyView ( )
onDestroyView( ) Example
onDetach ( )
onDetach( ) Example
newInstance( ) u Set up Fragment u Default Data u
Bundle u SetArgs( ) u GetArgs( )
New Instance( ) Example
How to Use
None
Fragment Manager u Manages Fragments in Activity u Holds list
of Fragments u Perform Transactions u Fluent Interface
Fragment Manager Example
Fragment ID
Fragment TAG
Identifying a Fragment u findFragmentById ( ) – Container ID
u findFragmentByTag( ) – String Constant
Fragment Transaction
Parts of a Transaction beginTransaction( ) Action commit( )
Basic Add, ID Example
Common Usage u Tablet u Tab Layout u Dialog Fragment
Tablet
Master Detail Flow
Fragments in Tablet u Dual Pane condition – Use Boolean
u Resource Qualifier
Resource Qualifier
Resource Qualifier u Change Configuration u Screen Width u 600
DPI – Tablet
Resource Qualifier Example
Tablet Example
Tab Layout
Tab Layout u Design Support Library u Fixed Tabs –
Most Common
View Pager
View Pager u Flip through pages u Support v4
Pager Adapter: 2 types
Fragment Pager Adapter
Fragment State Pager Adapter
Pager Adapter u getCount( ) – Number of Fragments u
getItem( ) – Position of Fragments u Fragment Pager Adapter u Fragment State Pager Adapter
Tab Layout & View Pager
Dialog Fragment
Dialog Fragment
Dialog Fragment u Restores AlertDialog u onCreateView( ) u onCreateDialog(
)
onCreateDialog( ) Example
Dialog Fragment Ex.
Odds and Ends u Navigation Drawer u Child Fragments u
Headless Fragments
None
None
Child Fragments
Headless Fragments
Best Practices u 3 – Fragments Activities u 5 –
Fragments Tab Layouts u Use Interfaces with Activities u Create early
None
None
None
Thank you @HopeDeveloper
None
Questions?