Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android開発の罠と、その避け方
Search
nakawai
April 23, 2017
Programming
0
18
Android開発の罠と、その避け方
nakawai
April 23, 2017
Tweet
Share
More Decks by nakawai
See All by nakawai
エンジニアがエンジニアリングマネージャーになって最初にやったこと
nakawai
2
880
電卓アプリで再帰降下法を使った話
nakawai
0
110
AndroidでTensorflow
nakawai
0
27
テンプレート作ると爆速Android 開発できる?
nakawai
0
16
AndroidでSRCNN 2017
nakawai
0
26
AndroidでSRCNNできる?
nakawai
0
41
Other Decks in Programming
See All in Programming
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
2
100
雑に思考を整理する技術と効能
konifar
58
29k
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
900
Ruby GitHub Packages
bkuhlmann
0
630
Tailwind CSSを本気でカスタマイズする方法
fsubal
13
5.2k
SIMD Parallel Programming with the Vector API
josepaumard
0
120
1BRC--Nerd Sniping the Java Community
gunnarmorling
0
340
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
410
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
ivargrimstad
0
1.1k
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
640
ゆるい個人開発のススメ
kuroppe1819
10
990
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
Featured
See All Featured
The Mythical Team-Month
searls
216
42k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
RailsConf 2023
tenderlove
4
540
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Optimizing for Happiness
mojombo
370
69k
The Language of Interfaces
destraynor
151
23k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
Typedesign – Prime Four
hannesfritz
36
2.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
227
16k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Practical Orchestrator
shlominoach
182
9.7k
Transcript
Android開発の ワナと、その避け方 @nakawai 2017/4/23 かものはし
開発中の ある日
原因を探ると Activity/Fragmentのメンバ変数 mHogeが、なぜかnull 再現不可
やりがち if(mHoge != null){...}
根本的な 原因は? なぜnullに?
答え: 再生成
Androidのメモリ管理 メモリが足りない ↓ backgroundのアプリを、いったん破棄 ↓ 必要なときに再生成
ルールを 知らないと、 状態が 復元されない
nullの理由 所定の手続きを 経ていなかった
主要コンポーネントの ライフサイクルを把握すれば 回避可能 • #onSavedInstanceState() • Fragment#setArguments() • Parcelable
テスト 「常にActivityを破棄」をON
微妙な点 コールバック記述が 冗長になる ダイアログなど
「Android開発の罠と、その避け方」 以上 なにか質問あれば