<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>나만 보는 개발 로그</title>
    <link>https://dwenn.tistory.com/</link>
    <description>&amp;quot;DwEnn&amp;quot;  
Developers, we ensure not null</description>
    <language>ko</language>
    <pubDate>Fri, 24 Jul 2026 21:19:55 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>DwEnn</managingEditor>
    <image>
      <title>나만 보는 개발 로그</title>
      <url>https://tistory1.daumcdn.net/tistory/2822747/attach/c0b9c2b92a3846aabfc28dd0fce91f32</url>
      <link>https://dwenn.tistory.com</link>
    </image>
    <item>
      <title>Medium 으로 이사합니다</title>
      <link>https://dwenn.tistory.com/120</link>
      <description>&lt;p data-ke-size=&quot;size16&quot;&gt;Medium 에서 새로 포스팅을 시작하려 합니다.&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote data-ke-style=&quot;style1&quot;&gt;&lt;span style=&quot;font-family: 'Noto Serif KR';&quot;&gt;'나만 보는 개발 로그' 가 아닌 모두가 볼 수 있는 기록을 공유하고 싶어졌습니다.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr contenteditable=&quot;false&quot; data-ke-type=&quot;horizontalRule&quot; data-ke-style=&quot;style1&quot; /&gt;&lt;/blockquote&gt;
&lt;ul style=&quot;list-style-type: disc;&quot; data-ke-list-type=&quot;disc&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: -apple-system, BlinkMacSystemFont, AppleSDGothicNeo-Regular, 'Malgun Gothic', '맑은 고딕', dotum, 돋움, sans-serif; letter-spacing: 0px;&quot;&gt;기존에는 단순 아카이빙용으로 티스토리를 활용하였습니다.(아닌 글들도 존재하지만 소수였지요  ) 이제는 저의 정리 형태를 바꾸어 보려고 합니다. 노션을 아카이빙용으로, medium 을 공유하는 글을 올리는 용도로 활용하고자 합니다.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;공유하는 글을 작성하고자 노력함으로써 공부하는 기술에 대한 개요 뿐만 아닌 동작 원리에 대해 이해하고자 합니다.&lt;/li&gt;
&lt;li&gt;또한 단순히 어떤 기술의 사용법을 공유하는 것이 아닌 +@ 의 특성을 가지는 글을 작성하고자 합니다.&lt;/li&gt;
&lt;li&gt;이를 위해서 기존의 글을 수정, 삭제하는 것보다는 새로운 곳에서 다시 시작하는것이 괜찮겠다고 판단했습니다.&lt;/li&gt;
&lt;li&gt;이젠 아래에서 양질의 글을 공유하도록 하겠습니다.&lt;/li&gt;
&lt;/ul&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&lt;a href=&quot;https://medium.com/@prgohn&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;https://medium.com/@prgohn&lt;/a&gt;&lt;/p&gt;
&lt;figure id=&quot;og_1649172859431&quot; contenteditable=&quot;false&quot; data-ke-type=&quot;opengraph&quot; data-ke-align=&quot;alignCenter&quot; data-og-type=&quot;profile&quot; data-og-title=&quot;DwEnn &amp;ndash; Medium&quot; data-og-description=&quot;Read writing from DwEnn on Medium. Android Dev. Every day, DwEnn and thousands of other voices read, write, and share important stories on Medium.&quot; data-og-host=&quot;medium.com&quot; data-og-source-url=&quot;https://medium.com/@prgohn&quot; data-og-url=&quot;https://medium.com/@prgohn&quot; data-og-image=&quot;https://scrap.kakaocdn.net/dn/KFnbw/hyNVHrdVuZ/1I2suDogdkmfFBmNTT7tKk/img.png?width=705&amp;amp;height=618&amp;amp;face=500_185_595_280,https://scrap.kakaocdn.net/dn/dk5FLk/hyNVKH7EIy/xXHdRrtMrV3eASWsinW8s0/img.png?width=1157&amp;amp;height=622&amp;amp;face=0_0_1157_622&quot;&gt;&lt;a href=&quot;https://medium.com/@prgohn&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; data-source-url=&quot;https://medium.com/@prgohn&quot;&gt;
&lt;div class=&quot;og-image&quot; style=&quot;background-image: url('https://scrap.kakaocdn.net/dn/KFnbw/hyNVHrdVuZ/1I2suDogdkmfFBmNTT7tKk/img.png?width=705&amp;amp;height=618&amp;amp;face=500_185_595_280,https://scrap.kakaocdn.net/dn/dk5FLk/hyNVKH7EIy/xXHdRrtMrV3eASWsinW8s0/img.png?width=1157&amp;amp;height=622&amp;amp;face=0_0_1157_622');&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;og-text&quot;&gt;
&lt;p class=&quot;og-title&quot; data-ke-size=&quot;size16&quot;&gt;DwEnn &amp;ndash; Medium&lt;/p&gt;
&lt;p class=&quot;og-desc&quot; data-ke-size=&quot;size16&quot;&gt;Read writing from DwEnn on Medium. Android Dev. Every day, DwEnn and thousands of other voices read, write, and share important stories on Medium.&lt;/p&gt;
&lt;p class=&quot;og-host&quot; data-ke-size=&quot;size16&quot;&gt;medium.com&lt;/p&gt;
&lt;/div&gt;
&lt;/a&gt;&lt;/figure&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p data-ke-size=&quot;size16&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/120</guid>
      <comments>https://dwenn.tistory.com/120#entry120comment</comments>
      <pubDate>Wed, 6 Apr 2022 00:36:02 +0900</pubDate>
    </item>
    <item>
      <title>DataBinding, Binding 객체 생성</title>
      <link>https://dwenn.tistory.com/118</link>
      <description>&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset='UTF-8'&gt;&lt;meta name='viewport' content='width=device-width initial-scale=1'&gt;

&lt;link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&amp;subset=latin,latin-ext' rel='stylesheet' type='text/css' /&gt;&lt;style type='text/css'&gt;html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:&quot;Lucida Console&quot;,Consolas,&quot;Courier&quot;,monospace; --title-bar-height:20px; }
.mac-os-11 { --title-bar-height:28px; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
.typora-export .task-list-item input { pointer-events: none; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write li &gt; figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; image-orientation: from-image; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type=&quot;checkbox&quot;], input[type=&quot;radio&quot;] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type=&quot;checkbox&quot;] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure &gt; table { margin: 0px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li blockquote { margin: 1rem 0px; }
li { margin: 0px; position: relative; }
blockquote &gt; :last-child { margin-bottom: 0px; }
blockquote &gt; :first-child, li &gt; :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; }
  #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  .typora-export #write { break-after: avoid; }
  .typora-export #write::after { height: 0px; }
  .is-mac table { break-inside: avoid; }
  .typora-export-show-outline .typora-export-sidebar { display: none; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p &gt; .md-image:only-child:not(.md-img-error) img, p &gt; img:only-child { display: block; margin: auto; }
#write.first-line-indent p &gt; .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; }
p &gt; .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
.MathJax_ref { fill: currentcolor; }
[contenteditable=&quot;true&quot;]:active, [contenteditable=&quot;true&quot;]:focus, [contenteditable=&quot;false&quot;]:active, [contenteditable=&quot;false&quot;]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item &gt; input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: &quot;.&quot;; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-fences-math .MathJax_SVG_Display, .md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: visible; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; zoom: 90%; }
#math-inline-preview-content { zoom: 1.1; }
.MathJax_SVG * { transition: none 0s ease 0s; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: &quot;Segoe UI Symbol&quot;, sans-serif; }
.md-diagram-panel &gt; svg { max-width: 100%; }
[lang=&quot;flow&quot;] svg, [lang=&quot;mermaid&quot;] svg { max-width: 100%; height: auto; }
[lang=&quot;mermaid&quot;] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }
mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); }
.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; }
.md-expand mark .md-meta { opacity: 0.3 !important; }
mark .md-meta { color: rgb(0, 0, 0); }
@media print {
  .typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; }
}
.md-diagram-panel .messageText { stroke: none !important; }
.md-diagram-panel .start-state { fill: var(--node-fill); }
.md-diagram-panel .edgeLabel rect { opacity: 1 !important; }
.md-require-zoom-fix foreignobject { font-size: var(--mermaid-font-zoom); }
.md-fences.md-fences-math { font-size: 1em; }
.md-fences-math .MathJax_SVG_Display { margin-top: 8px; cursor: default; }
.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; }
.md-fences-advanced:not(.md-focus) { background: inherit; }
.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; }
.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; }
.typora-export-show-outline #write { --webkit-flex:2; flex: 2 1 0%; }
.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; }
@media screen and (max-width: 1024px) {
  .typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; }
}
@media screen and (max-width: 800px) {
  .typora-export-sidebar { display: none; }
}
.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; }
.outline-content ul { margin-top: 0px; margin-bottom: 0px; }
.outline-content strong { font-weight: 400; }
.outline-expander { width: 1rem; height: 1.42857rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; }
.outline-expander::before { content: &quot;&quot;; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; }
.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; }
.outline-expander:hover::before { content: &quot;&quot;; }
.outline-h1 &gt; .outline-item { padding-left: 0px; }
.outline-h2 &gt; .outline-item { padding-left: 1em; }
.outline-h3 &gt; .outline-item { padding-left: 2em; }
.outline-h4 &gt; .outline-item { padding-left: 3em; }
.outline-h5 &gt; .outline-item { padding-left: 4em; }
.outline-h6 &gt; .outline-item { padding-left: 5em; }
.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; }
.outline-label:hover { text-decoration: underline; }
.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); }
.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left: 28px solid transparent; border-right: 28px solid transparent; }
.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; }
.outline-item-open &gt; .outline-item &gt; .outline-expander::before { content: &quot;&quot;; }
.outline-children { display: none; }
.info-panel-tab-wrapper { display: none; }
.outline-item-open &gt; .outline-children { display: block; }
.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; }
.typora-export .outline-item:hover { margin-right: -8px; border-right: 8px solid transparent; }
.typora-export .outline-expander::before { content: &quot;+&quot;; font-family: inherit; top: -1px; }
.typora-export .outline-expander:hover::before, .typora-export .outline-item-open &gt; .outline-item &gt; .outline-expander::before { content: &quot;−&quot;; }
.typora-export-collapse-outline .outline-children { display: none; }
.typora-export-collapse-outline .outline-item-open &gt; .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; }
.typora-export-no-collapse-outline .outline-expander::before { content: &quot;&quot; !important; }
.typora-export-show-outline .outline-item-active &gt; .outline-item .outline-label { font-weight: 700; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
span.cm-underlined { text-decoration: underline; }
span.cm-strikethrough { text-decoration: line-through; }
.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); }
.cm-tw-deleted { text-decoration: line-through; }
.cm-tw-header5 { font-weight: 700; }
.cm-tw-listitem:first-child { padding-left: 10px; }
.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; }
.cm-tw-underline { text-decoration: underline; }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}


:root {
    --side-bar-bg-color: #fafafa;
    --control-text-color: #777;
}

@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&amp;subset=latin,latin-ext);

/* open-sans-regular - latin-ext_latin */
  /* open-sans-italic - latin-ext_latin */
    /* open-sans-700 - latin-ext_latin */
    /* open-sans-700italic - latin-ext_latin */
  html {
    font-size: 16px;
}

body {
    font-family: &quot;Open Sans&quot;,&quot;Clear Sans&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif;
    color: rgb(51, 51, 51);
    line-height: 1.6;
}

#write {
    max-width: 860px;
  	margin: 0 auto;
  	padding: 30px;
    padding-bottom: 100px;
}

@media only screen and (min-width: 1400px) {
	#write {
		max-width: 1024px;
	}
}

@media only screen and (min-width: 1800px) {
	#write {
		max-width: 1200px;
	}
}

#write &gt; ul:first-child,
#write &gt; ol:first-child{
    margin-top: 30px;
}

a {
    color: #4183C4;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    position: relative;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: bold;
    line-height: 1.4;
    cursor: text;
}
h1:hover a.anchor,
h2:hover a.anchor,
h3:hover a.anchor,
h4:hover a.anchor,
h5:hover a.anchor,
h6:hover a.anchor {
    text-decoration: none;
}
h1 tt,
h1 code {
    font-size: inherit;
}
h2 tt,
h2 code {
    font-size: inherit;
}
h3 tt,
h3 code {
    font-size: inherit;
}
h4 tt,
h4 code {
    font-size: inherit;
}
h5 tt,
h5 code {
    font-size: inherit;
}
h6 tt,
h6 code {
    font-size: inherit;
}
h1 {
    font-size: 2.25em;
    line-height: 1.2;
    border-bottom: 1px solid #eee;
}
h2 {
    font-size: 1.75em;
    line-height: 1.225;
    border-bottom: 1px solid #eee;
}

/*@media print {
    .typora-export h1,
    .typora-export h2 {
        border-bottom: none;
        padding-bottom: initial;
    }

    .typora-export h1::after,
    .typora-export h2::after {
        content: &quot;&quot;;
        display: block;
        height: 100px;
        margin-top: -96px;
        border-top: 1px solid #eee;
    }
}*/

h3 {
    font-size: 1.5em;
    line-height: 1.43;
}
h4 {
    font-size: 1.25em;
}
h5 {
    font-size: 1em;
}
h6 {
   font-size: 1em;
    color: #777;
}
p,
blockquote,
ul,
ol,
dl,
table{
    margin: 0.8em 0;
}
li&gt;ol,
li&gt;ul {
    margin: 0 0;
}
hr {
    height: 2px;
    padding: 0;
    margin: 16px 0;
    background-color: #e7e7e7;
    border: 0 none;
    overflow: hidden;
    box-sizing: content-box;
}

li p.first {
    display: inline-block;
}
ul,
ol {
    padding-left: 30px;
}
ul:first-child,
ol:first-child {
    margin-top: 0;
}
ul:last-child,
ol:last-child {
    margin-bottom: 0;
}
blockquote {
    border-left: 4px solid #dfe2e5;
    padding: 0 15px;
    color: #777777;
}
blockquote blockquote {
    padding-right: 0;
}
table {
    padding: 0;
    word-break: initial;
}
table tr {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 0;
}
table tr:nth-child(2n),
thead {
    background-color: #f8f8f8;
}
table th {
    font-weight: bold;
    border: 1px solid #dfe2e5;
    border-bottom: 0;
    margin: 0;
    padding: 6px 13px;
}
table td {
    border: 1px solid #dfe2e5;
    margin: 0;
    padding: 6px 13px;
}
table th:first-child,
table td:first-child {
    margin-top: 0;
}
table th:last-child,
table td:last-child {
    margin-bottom: 0;
}

.CodeMirror-lines {
    padding-left: 4px;
}

.code-tooltip {
    box-shadow: 0 1px 1px 0 rgba(0,28,36,.3);
    border-top: 1px solid #eef2f2;
}

.md-fences,
code,
tt {
    border: 1px solid #e7eaed;
    background-color: #f8f8f8;
    border-radius: 3px;
    padding: 0;
    padding: 2px 4px 0px 4px;
    font-size: 0.9em;
}

code {
    background-color: #f3f4f4;
    padding: 0 2px 0 2px;
}

.md-fences {
    margin-bottom: 15px;
    margin-top: 15px;
    padding-top: 8px;
    padding-bottom: 6px;
}


.md-task-list-item &gt; input {
  margin-left: -1.3em;
}

@media print {
    html {
        font-size: 13px;
    }
    table,
    pre {
        page-break-inside: avoid;
    }
    pre {
        word-wrap: break-word;
    }
}

.md-fences {
	background-color: #f8f8f8;
}
#write pre.md-meta-block {
	padding: 1rem;
    font-size: 85%;
    line-height: 1.45;
    background-color: #f7f7f7;
    border: 0;
    border-radius: 3px;
    color: #777777;
    margin-top: 0 !important;
}

.mathjax-block&gt;.code-tooltip {
	bottom: .375rem;
}

.md-mathjax-midline {
    background: #fafafa;
}

#write&gt;h3.md-focus:before{
	left: -1.5625rem;
	top: .375rem;
}
#write&gt;h4.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
#write&gt;h5.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
#write&gt;h6.md-focus:before{
	left: -1.5625rem;
	top: .285714286rem;
}
.md-image&gt;.md-meta {
    /*border: 1px solid #ddd;*/
    border-radius: 3px;
    padding: 2px 0px 0px 4px;
    font-size: 0.9em;
    color: inherit;
}

.md-tag {
    color: #a7a7a7;
    opacity: 1;
}

.md-toc { 
    margin-top:20px;
    padding-bottom:20px;
}

.sidebar-tabs {
    border-bottom: none;
}

#typora-quick-open {
    border: 1px solid #ddd;
    background-color: #f8f8f8;
}

#typora-quick-open-item {
    background-color: #FAFAFA;
    border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee;
    border-style: solid;
    border-width: 1px;
}

/** focus mode */
.on-focus-mode blockquote {
    border-left-color: rgba(85, 85, 85, 0.12);
}

header, .context-menu, .megamenu-content, footer{
    font-family: &quot;Segoe UI&quot;, &quot;Arial&quot;, sans-serif;
}

.file-node-content:hover .file-node-icon,
.file-node-content:hover .file-node-open-state{
    visibility: visible;
}

.mac-seamless-mode #typora-sidebar {
    background-color: #fafafa;
    background-color: var(--side-bar-bg-color);
}

.md-lang {
    color: #b4654d;
}

/*.html-for-mac {
    --item-hover-bg-color: #E6F0FE;
}*/

#md-notification .btn {
    border: 0;
}

.dropdown-menu .divider {
    border-color: #e5e5e5;
    opacity: 0.4;
}

.ty-preferences .window-content {
    background-color: #fafafa;
}

.ty-preferences .nav-group-item.active {
    color: white;
    background: #999;
}

.menu-item-container a.menu-style-btn {
    background-color: #f5f8fa;
    background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0)); 
}



&lt;/style&gt;&lt;title&gt;DataBinding 객체 생성 1b2701ed69ce423aa66c3e5f69f25406&lt;/title&gt;
&lt;/head&gt;
&lt;body class='typora-export os-windows'&gt;&lt;div class='typora-export-content'&gt;
&lt;div id='write'  class=''&gt;&lt;h1 id='databinding-binding-객체-생성'&gt;&lt;span&gt;DataBinding, Binding 객체 생성&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span&gt;나는 DatabindingUtil 클래스로 bindng 객체를 생성해서 사용하고 있었다. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;하지만 다른 사람들이 작성한 databinding 코드들을 보면 여러 방법으로 binding 객체를 생성해주는 것을 보고 내가 제대로 쓰고 있는 것에 대한 의문이 들었다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;inflate()&lt;/code&gt;&lt;span&gt;, &lt;/span&gt;&lt;code&gt;bind()&lt;/code&gt;&lt;span&gt; 의 차이도 궁금하던 차였고 ..&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;이러한 의문들을 해결하기 위해 대표적인 Activity, Fragment 에서의 사용법을 분석해보았다.&lt;/span&gt;&lt;/p&gt;&lt;h2 id='activity'&gt;&lt;span&gt;Activity&lt;/span&gt;&lt;/h2&gt;&lt;h3 id='activitymainbindinginflateinflater-layoutinflator'&gt;&lt;strong&gt;&lt;span&gt;ActivityMainBinding.inflate(inflater: LayoutInflator)&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;kotlin&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;kotlin&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot; style=&quot;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;onCreate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;savedInstanceState&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;) {&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;&quot; style=&quot;position: relative;&quot;&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;super&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;onCreate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;savedInstanceState&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;&quot; style=&quot;position: relative;&quot;&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;binding&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;ActivityMainBinding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;inflate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;layoutInflater&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;setContentView&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;root&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 138px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 138px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span&gt;생성된 Binding 객체의 static api 를 사용하여 레이아웃 inflation&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ol start='' &gt;&lt;li&gt;&lt;span&gt;Activity 의 &lt;/span&gt;&lt;u&gt;&lt;span&gt;layoutInflater&lt;/span&gt;&lt;/u&gt;&lt;span&gt; 전달하여 Binding 객체를 생성&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Binding 객체의 root view 를 파라미터로 &lt;/span&gt;&lt;code&gt;setContentView(view: View)&lt;/code&gt;&lt;span&gt; 호출하여 레이아웃 inflation&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;blockquote&gt;&lt;p&gt;&lt;u&gt;&lt;span&gt;LayoutInflater&lt;/span&gt;&lt;/u&gt;
&lt;span&gt; : xml 을 View 객체로 변환시켜 준다. 컴파일 시점에 완성된 xml 파일에 대해서만 변환이 가능하다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;h3 id='databindingutilsetcontentviewtactivity-activity-int-layoutid'&gt;&lt;strong&gt;&lt;span&gt;DataBindingUtil.setContentView&lt;/span&gt;&lt;T&gt;&lt;span&gt;(activity: Activity, int layoutId)&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;kotlin&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;kotlin&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot; style=&quot;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;onCreate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;savedInstanceState&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;) {&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;super&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;onCreate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;savedInstanceState&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;binding&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;DataBindingUtil&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;setContentView&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;ActivityMainBinding&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt;(&lt;span class=&quot;cm-keyword&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;R&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;layout&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;activity_main&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 138px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 138px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span&gt;DataBindingUtil 클래스의 static api 를 사용하여 레이아웃 inflation&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;ol start='' &gt;&lt;li&gt;&lt;span&gt;Activity, layout 의 리소스 아이디를 전달하여 Binding 객체를 생성 및 레이아웃 inflation&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;code&gt;ActivityMainBinding.inflate()&lt;/code&gt;&lt;span&gt; 와 다르게 &lt;/span&gt;&lt;code&gt;setContentView(view: View)&lt;/code&gt;&lt;span&gt; 를 호출하지 않는데 메소드의 내부 동작을 살펴보면 그 이유를 알 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span&gt;DataBindingUtil.java&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;java&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;java&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot; style=&quot;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;ViewDataBinding&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;setContentView&lt;/span&gt;(&lt;span class=&quot;cm-meta&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;Activity&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;activity&lt;/span&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable-3&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;layoutId&lt;/span&gt;, &lt;span class=&quot;cm-meta&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;DataBindingComponent&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;bindingComponent&lt;/span&gt;) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;activity&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;setContentView&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;layoutId&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;&quot; style=&quot;position: relative;&quot;&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;View&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;decorView&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;activity&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;getWindow&lt;/span&gt;().&lt;span class=&quot;cm-variable&quot;&gt;getDecorView&lt;/span&gt;();&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;ViewGroup&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;contentView&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; (&lt;span class=&quot;cm-variable&quot;&gt;ViewGroup&lt;/span&gt;) &lt;span class=&quot;cm-variable&quot;&gt;decorView&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;findViewById&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;android&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;R&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;id&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;content&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;bindToAddedViews&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;bindingComponent&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;contentView&lt;/span&gt;, &lt;span class=&quot;cm-number&quot;&gt;0&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;layoutId&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 161px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 161px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;span&gt;API 내부적으로 파라미터로 전달받은 Activity 의 setContentView() 호출해주고 있다.&lt;/span&gt;&lt;/p&gt;&lt;h3 id='왜-이런-차이가-있는-걸까-'&gt;&lt;strong&gt;&lt;span&gt;왜 이런 차이가 있는 걸까 ?&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;p&gt;&lt;span&gt;ActivityMainBinding 클래스와 DataBindingUtil 클래스의 사용 상 차이를 살펴보면, ActivityMainBinding 객체 내에는 resId(?)를 포함하고 있기 때문에 resId 전달 없이 Binding 객체를 생성할 수 있는 것으로 추측된다.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span&gt;정말 그럴까 ? build 폴더 내 생성된 클래스 파일을 열어 보았다.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span&gt;ActivityMainBinding.class&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;java&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;java&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot; style=&quot;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-meta&quot;&gt;@NonNull&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;ActivityMainBinding&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;inflate&lt;/span&gt;(&lt;span class=&quot;cm-meta&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;LayoutInflater&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;inflate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;DataBindingUtil&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;getDefaultComponent&lt;/span&gt;());&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot;&gt;/** @deprecated */&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-meta&quot;&gt;@Deprecated&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-meta&quot;&gt;@NonNull&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;ActivityMainBinding&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;inflate&lt;/span&gt;(&lt;span class=&quot;cm-meta&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;LayoutInflater&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;, &lt;span class=&quot;cm-meta&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;cm-variable-3&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;component&lt;/span&gt;) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; (&lt;span class=&quot;cm-variable&quot;&gt;ActivityMainBinding&lt;/span&gt;)&lt;span class=&quot;cm-variable&quot;&gt;ViewDataBinding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;inflateInternal&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;,&lt;span class=&quot;cm-number&quot;&gt;2131296284&lt;/span&gt;,(&lt;span class=&quot;cm-variable&quot;&gt;ViewGroup&lt;/span&gt;)&lt;span class=&quot;cm-atom&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;cm-atom&quot;&gt;false&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;component&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 299px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 299px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;span&gt;API 콜 스택 : &lt;/span&gt;&lt;code&gt;inflate(inflater: LayoutInflator)&lt;/code&gt;&lt;span&gt;  → &lt;/span&gt;&lt;code&gt;inflateLayoutInflater inflater, Object component)&lt;/code&gt;&lt;span&gt; →  &lt;/span&gt;&lt;code&gt;static &amp;lt;T extends ViewDataBinding&amp;gt; T inflateInternal(LayoutInflater inflater, int layoutId, ViewGroup parent, boolean attachToParent, Object bindingComponent)&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;추측한대로 &lt;/span&gt;&lt;code&gt;ViewDataBinding.inflateInternal()&lt;/code&gt;&lt;span&gt; 호출 시에 전달하는 activity_main.xml 의 layoutId 값이 클래스 파일 내에 정의 되어 있었다.&lt;/span&gt;&lt;/p&gt;&lt;h2 id='fragment-listview-or-recyclerview'&gt;&lt;span&gt;Fragment, ListView or RecyclerView&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;Activity 처럼 &lt;/span&gt;&lt;code&gt;setContentView()&lt;/code&gt;&lt;span&gt; 호출이 필요하지 않고 binding 객체를 생성하여 모든 작업이 가능하다.&lt;/span&gt;&lt;/p&gt;&lt;h3 id='fragmentmainbindinginflateinflater-layoutinflator-parent-viewgroup-attachtoparent-boolean'&gt;&lt;span&gt;Fragment&lt;/span&gt;&lt;strong&gt;&lt;span&gt;MainBinding.inflate(inflater: LayoutInflator, parent: ViewGroup, attachToParent: Boolean)&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;kotlin&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;kotlin&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.25px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;onCreateView&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;LayoutInflater&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;container&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;ViewGroup&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;savedInstanceState&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;): &lt;span class=&quot;cm-variable&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt; {&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;FragmentMainBinding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;inflate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;container&lt;/span&gt;, &lt;span class=&quot;cm-atom&quot;&gt;false&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 115px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 115px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span&gt;생성된 Binding 객체의 static api 를 사용하여 View 를 리턴&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;h3 id='databindingutilinflateinflater-layoutinflator-int-layoutid-parent-viewgroup-attachtoparent-boolean'&gt;&lt;span&gt;DataBindingUtil&lt;/span&gt;&lt;strong&gt;&lt;span&gt;.inflate(inflater: LayoutInflator, int: layoutId, parent: ViewGroup, attachToParent: Boolean)&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;kotlin&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;kotlin&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.25px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;onCreateView&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;LayoutInflater&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;container&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;ViewGroup&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;savedInstanceState&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;): &lt;span class=&quot;cm-variable&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt; {&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;DataBindingUtil&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;inflate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;R&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;layout&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;fragment_main&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;container&lt;/span&gt;, &lt;span class=&quot;cm-atom&quot;&gt;false&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 115px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 115px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;&lt;span&gt;DataBindingUtil 클래스의 static api 를 사용하여 View 를 리턴&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;DataBindingUtil 은 resId 를 모르기 때문에, &lt;/span&gt;&lt;code&gt;FragmentMainBinding.inflate()&lt;/code&gt;&lt;span&gt; 와 다르게 추가로 layoutResId 를 전달하는 것 외에는 별다른 특이점은 보이지 않는다.&lt;/span&gt;&lt;/p&gt;&lt;h3 id='fragmentmainbindingbindview-viewdatabindingutilbindview-view'&gt;&lt;span&gt;Fragment&lt;/span&gt;&lt;strong&gt;&lt;span&gt;MainBinding.bind(view: View)&amp;amp;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;DataBindingUtil.bind(view: View)&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span&gt;또 다른 Binding 객체를 생성하기 위한 방법으로 &lt;/span&gt;&lt;code&gt;bind()&lt;/code&gt;&lt;span&gt; 를 사용하는 방법이 있다. &lt;/span&gt;&lt;code&gt;inflate()&lt;/code&gt;&lt;span&gt; 와는 다르게 이미 inflate 된 view 를 전달 받는 방식이기 때문에 view 만을 파라미터로 받는다.&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;kotlin&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;kotlin&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot; style=&quot;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;lateinit&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;binding&lt;/span&gt; : &lt;span class=&quot;cm-variable&quot;&gt;FragmentMainBinding&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;override&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;onCreateView&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;LayoutInflater&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;container&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;ViewGroup&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;savedInstanceState&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt;): &lt;span class=&quot;cm-variable&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;?&lt;/span&gt; {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot;&gt;// LayoutInflater 를 통해 미리 View 를 생성&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;view&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;inflater&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;inflate&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;R&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;layout&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;fragment_main&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;container&lt;/span&gt;, &lt;span class=&quot;cm-atom&quot;&gt;false&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;DataBindingUtil&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;view&lt;/span&gt;)&lt;span class=&quot;cm-operator&quot;&gt;!!&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;or&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;FragmentMainBinding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;view&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;root&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 230px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 230px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;span&gt;이 처럼 Fragment 에서 사용 가능하고 한 가지 특이점은 &lt;/span&gt;&lt;code&gt;DataBindingUtil.bind(view: View)&lt;/code&gt;&lt;span&gt; 는 nullable 객체를 리턴한다는 것이다. 때문에 &lt;/span&gt;&lt;code&gt;!!&lt;/code&gt;&lt;span&gt; 를 추가하여 lateinit 을 적용하였는데,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;이것 역시 내부 동작을 보면 이해 가능하다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span&gt;FragmentMainBinding.class&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;java&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;java&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot; style=&quot;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot;&gt;/** @deprecated */&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-meta&quot;&gt;@Deprecated&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;FragmentMainBinding&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;cm-meta&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;View&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;view&lt;/span&gt;, &lt;span class=&quot;cm-meta&quot;&gt;@Nullable&lt;/span&gt; &lt;span class=&quot;cm-variable-3&quot;&gt;Object&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;component&lt;/span&gt;) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; (&lt;span class=&quot;cm-variable&quot;&gt;FragmentMainBinding&lt;/span&gt;)&lt;span class=&quot;cm-variable&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;component&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;view&lt;/span&gt;, &lt;span class=&quot;cm-number&quot;&gt;2131427358&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 138px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 138px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;span&gt;빌드된 클래스 파일을 보면 view 를 전달 받았지만 내부적으로 resId 를 전달하며 기능을 수행하는 모습이다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span&gt;DataBindingUtil.class&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;java&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;java&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-meta&quot;&gt;@Nullable&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;ViewDataBinding&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;cm-meta&quot;&gt;@NonNull&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;View&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;root&lt;/span&gt;) {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-keyword&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;bind&lt;/span&gt;(&lt;span class=&quot;cm-variable&quot;&gt;root&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;sDefaultComponent&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 92px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 92px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt;&lt;span&gt;내부 동작을 보면 전달받은 view 의 태그를 통해 &lt;/span&gt;&lt;code&gt;DataBinderMapper&lt;/code&gt;&lt;span&gt; 에 저장된 binding 객체를 전달하는 동작을 수행한다. 때문에 찾지 못한 경우를 위한 예외 처리로 nullable 을 리턴해주고 있는것 같다.&lt;/span&gt;&lt;/p&gt;&lt;h2 id='결론'&gt;&lt;span&gt;결론&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span&gt;binding 객체를 생성하기 위한 여러 방법들이 제공되고 있으니 경우에 알맞게 적용하면 된다 !!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt; ...&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;나는 아래처럼 BaseActivity, BaseFragment 내에 정의해서 사용하고 있다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span&gt; (피드백 주시는 고수님 감사합니다.)&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;pre class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; spellcheck=&quot;false&quot; lang=&quot;kotlin&quot; style=&quot;break-inside: unset;&quot;&gt;&lt;div class=&quot;CodeMirror cm-s-inner CodeMirror-wrap&quot; lang=&quot;kotlin&quot;&gt;&lt;div style=&quot;overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;&quot;&gt;&lt;textarea autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; tabindex=&quot;0&quot; style=&quot;position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scrollbar-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-filler&quot; cm-not-content=&quot;true&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-scroll&quot; tabindex=&quot;-1&quot;&gt;&lt;div class=&quot;CodeMirror-sizer&quot; style=&quot;margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;div style=&quot;position: relative; top: 0px;&quot;&gt;&lt;div class=&quot;CodeMirror-lines&quot; role=&quot;presentation&quot;&gt;&lt;div role=&quot;presentation&quot; style=&quot;position: relative; outline: none;&quot;&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;pre&gt;&lt;span&gt;xxxxxxxxxx&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-measure&quot;&gt;&lt;/div&gt;&lt;div style=&quot;position: relative; z-index: 1;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-code&quot; role=&quot;presentation&quot; style=&quot;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;CodeMirror-activeline-background CodeMirror-linebackground&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutter-background CodeMirror-activeline-gutter&quot; style=&quot;left: 0px; width: 0px;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot;&gt;// BaseActivity&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;BaseActivity&lt;/span&gt; : &lt;span class=&quot;cm-variable&quot;&gt;AppCompatActivity&lt;/span&gt;() {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;inline&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot;&gt;reified&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt; : &lt;span class=&quot;cm-variable&quot;&gt;ViewDataBinding&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;bindingView&lt;/span&gt;(&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;@LayoutRes&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;resID&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;Int&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;  ): &lt;span class=&quot;cm-variable&quot;&gt;Lazy&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;lazy&lt;/span&gt; {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;DataBindingUtil&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;setContentView&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt;(&lt;span class=&quot;cm-keyword&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;resID&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  .&lt;span class=&quot;cm-variable&quot;&gt;apply&lt;/span&gt; { &lt;span class=&quot;cm-keyword&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;lifecycleOwner&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;@BaseActivity&lt;/span&gt; }&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  }&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot;&gt;// BaseFragment&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot;&gt;abstract&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;cm-def&quot;&gt;BaseFragment&lt;/span&gt; : &lt;span class=&quot;cm-variable&quot;&gt;Fragment&lt;/span&gt;() {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;inline&lt;/span&gt; &lt;span class=&quot;cm-keyword&quot;&gt;fun&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot;&gt;reified&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt; : &lt;span class=&quot;cm-variable&quot;&gt;ViewDataBinding&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;binding&lt;/span&gt;(&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;lifecycleOwner&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;LifecycleOwner&lt;/span&gt;,&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;@LayoutRes&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;resID&lt;/span&gt;: &lt;span class=&quot;cm-variable&quot;&gt;Int&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp;  ): &lt;span class=&quot;cm-variable&quot;&gt;Lazy&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;lazy&lt;/span&gt; {&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;cm-variable&quot;&gt;DataBindingUtil&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;setContentView&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;cm-operator&quot;&gt;&amp;gt;&lt;/span&gt;(&lt;span class=&quot;cm-keyword&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;cm-variable&quot;&gt;resID&lt;/span&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  .&lt;span class=&quot;cm-variable&quot;&gt;apply&lt;/span&gt; { &lt;span class=&quot;cm-keyword&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;cm-variable&quot;&gt;lifecycleOwner&lt;/span&gt; &lt;span class=&quot;cm-operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;cm-variable&quot;&gt;lifecycleOwner&lt;/span&gt; }&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  }&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;&quot; style=&quot;position: relative;&quot;&gt;&lt;pre class=&quot; CodeMirror-line &quot; role=&quot;presentation&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;padding-right: 0.1px;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 506px;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;CodeMirror-gutters&quot; style=&quot;display: none; height: 506px;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;h3 id='references'&gt;&lt;span&gt;References&lt;/span&gt;&lt;/h3&gt;&lt;hr /&gt;&lt;p&gt;&lt;a href='https://developer.android.com/topic/libraries/data-binding/generated-binding#create'&gt;&lt;span&gt;https://developer.android.com/topic/libraries/data-binding/generated-binding#create&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</description>
      <category>프로그래밍/Android</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/118</guid>
      <comments>https://dwenn.tistory.com/118#entry118comment</comments>
      <pubDate>Sun, 11 Jul 2021 20:39:05 +0900</pubDate>
    </item>
    <item>
      <title>String API, isBlank() vs isEmpty()</title>
      <link>https://dwenn.tistory.com/117</link>
      <description>&lt;h1 cid=&quot;n30&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;String API, isBlank() vs isEmpty()&lt;/span&gt;&lt;/h1&gt;&lt;p cid=&quot;n31&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;우린 Android 에서 java 언어로 String 의 null or empty check 를 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;TextUtils.isEmpty()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 로 하곤 했을 것이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n32&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;코틀린에서는 String 클래스 내 API 로 isBlank() 와 isEmpty() 두 가지를 제공한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n33&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;사용 시 자주 헷갈리는 두 API 차이를 분석해보자.&lt;/span&gt;&lt;/p&gt;&lt;h2 cid=&quot;n34&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;isBlank()&lt;/span&gt;&lt;/h2&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n35&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;CharSequence&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;isBlank&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(): &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;Boolean&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;blockquote cid=&quot;n36&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n37&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;문자열이 비어 있거나 공백 문자만으로 구성되어 있으면 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;true&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 리턴한다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n38&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;link&quot; class=&quot; md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a spellcheck=&quot;false&quot; href=&quot;https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/is-blank.html&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Kotlin, isBlank&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n86&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n39&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading md-focus&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;isEmpty()&lt;/span&gt;&lt;/h2&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n40&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;CharSequence&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;isEmpty&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(): &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;Boolean&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;blockquote cid=&quot;n41&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n42&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;문자열이 비어있으면 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;true&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 리턴한다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n43&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;link&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a spellcheck=&quot;false&quot; href=&quot;https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/is-empty.html&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Kotlin, isEmpty&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n82&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;p cid=&quot;n44&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n44&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;두 API 에 대한 설명을 코틀린 공식 문서에서 가져왔다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n45&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;정의만 보아서는 확실히 이해가 되지 않기 때문에 간단한 테스트를 해보았다.&lt;/span&gt;&lt;/p&gt;&lt;h3 cid=&quot;n46&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Test String&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n47&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;s1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;s2&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;s3&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;\\n&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;s4&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;NotEmpty&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;s5&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;&quot;&quot; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;trimIndent&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h3 cid=&quot;n48&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;테스트 결과&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n49&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// isEmpty()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s2&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s3&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s4&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s5&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// isBlank()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s2&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s3&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s4&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;false&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;s5&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2 cid=&quot;n50&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;결론&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n51&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;isEmpty() 는 단순히 문자열이 비어 있는지 여부를 검사하며,&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n52&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;isBlank() 는 문자열이 개행 문자를 포함하고 있는지 여부까지 검사한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n53&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;즉, 아래의 두 결과는 일치한다는 것을 알 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n54&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;s2&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot; &quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;s2 ${s2.isBlank()}&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// print true&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;s2 ${s2.trim().isEmpty()}&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// print true&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/Kotlin</category>
      <category>Kotlin</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/117</guid>
      <comments>https://dwenn.tistory.com/117#entry117comment</comments>
      <pubDate>Sun, 14 Jun 2020 18:22:04 +0900</pubDate>
    </item>
    <item>
      <title>[Android] getLocationOnScreen vs getLocationInWindow()</title>
      <link>https://dwenn.tistory.com/116</link>
      <description>&lt;h1 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;getLocationOnScreen vs getLocationInWindow()&lt;/span&gt;&lt;/h1&gt;&lt;p cid=&quot;n2&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;두 메소드 모두 뷰의 좌표값을 얻기 위해 종종 쓰는 메소드이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n3&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;둘의 차이를 비교하기 전에 Android Developers 에서의 정의를 살펴보자.&lt;/span&gt;&lt;/p&gt;&lt;h4 cid=&quot;n4&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;public void getLoactionInWindow(int[] outLocation)&lt;/span&gt;&lt;/h4&gt;&lt;blockquote cid=&quot;n5&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n6&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;@param outLocation&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; int : 좌표를 보유할 두 정수 배열&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n7&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;window 에서 view 의 좌표를 계산한다. 메소드가 리턴 된 후, 배열에는 x 밑 y 위치가 순서대로 포함된다.&lt;/span&gt;&lt;/p&gt;&lt;h4 cid=&quot;n8&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;public void getLocationOnScreen(int[] outLocation)&lt;/span&gt;&lt;/h4&gt;&lt;blockquote cid=&quot;n9&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n10&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;@param outLocation&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; int : 좌표를 보유할 두 정수 배열&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n11&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;screen 에서 view 의 좌표를 계산한다. 메소드가 리턴 된 후, 배열에는 x 밑 y 위치가 순서대로 포함된다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n12&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n13&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;[참조] &lt;/span&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://developer.android.com/reference/android/view/View&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://developer.android.com/reference/android/view/View&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n14&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;정의된 문서를 보면, 좌표값을 가져오는 기준이 window / screen 의 차이라는 것을 알 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n15&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h4 cid=&quot;n16&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그렇다면 window 영역과 screen 영역의 다른점은 무엇일까 ? &lt;/span&gt;&lt;/h4&gt;&lt;p cid=&quot;n17&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;link&quot; class=&quot; md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a spellcheck=&quot;false&quot; href=&quot;https://stackoverflow.com/questions/17672891/getlocationonscreen-vs-getlocationinwindow&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이곳&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 을 보면 아래와 같이 설명하고 있다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n18&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;|--&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;phone&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;screen&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;-----&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;activity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;---|&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;|--------&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;status&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;-------------------|&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;|-------------------------------------|&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n19&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;우리가 보는 휴대폰 화면은 이와같은 영역으로 구분되며, &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n20&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;getLocationOnScreen() 은 phone screen&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 을 &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n21&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;getLocationInWindow() 는 activity window&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 기준으로 한다고 한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n22&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;하지만 이것만 보고는 명확히 차이를 인지할수가 없었고 다른 답변을 보고 차이를 인지할 수 있었는데, 이와 같이 설명하고 있다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n23&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n24&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;일반적으로 window 의 크기는 screen 크기와 동일하기 때문에 getLocationOnScreen() 과 getLocationInWindow() 는 대부분 같은 값을 리턴한다. 그러나 때때로 window 가 screen 보다 작을 때가 있다. ( &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;예, dialog 나 custom system keyboard 에서&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; )&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n25&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그렇기에 원하는 좌표가 screen 과 관계가 있다면, &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;대부분 activity&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 에서, getLocationOnScreen() 을 쓰는것이 좋고&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n26&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;만약 screen 보다 window 의 view 를 사용하는 경우, &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;dialog 나 custom keyboard&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;, getLocationInWindow() 를 사용하는 것이 적절하다. &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n27&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;간단한 테스트를 해보고 알맞게 사용해보자.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n28&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;screen 과 window 의 크기가 동일한&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; activity 를 만들고&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n29&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;onCreate() 에서 이와같이 로그를 찍었다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n30&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Button&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Button&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;findViewById&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;dt_btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;setOnClickListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;View&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;OnClickListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-meta&quot; style=&quot;box-sizing: border-box; color: rgb(85, 85, 85); font-family: Terminal;&quot;&gt;@Override&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;onClick&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;View&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;v&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[] &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[] &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getLocationInWindow&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Log&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;TAG&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;loc in window : &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;, &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getLocationOnScreen&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Log&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;TAG&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;loc on screen : &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;] &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;, &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;]);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getLeft&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;top&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getTop&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getRight&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bottom&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getBottom&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Log&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;TAG&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;btn left : &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;, right : &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;, top : &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;top&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;, bottom : &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bottom&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  });&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n31&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;여기서 주의할 점이 onCreate() 시점에 해당 뷰의 좌표값을 얻으려 하면 0 을 리턴한다는 것이다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n32&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;뷰가 완전히 그려지기 이전에 좌표값을 구하려하기 때문이라는데 button 의 onclick event 로 값을 얻어오는 것으로 구현하여 해결하였다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n33&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이 테스트를 진행하며 getLeft(), getRight() .. 값도 테스트 하였는데, &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n34&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이 메소드들은 해당 뷰와 부모 뷰와의 관계 값을 리턴해준다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n35&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;window&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;520&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;1248&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;screen&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;520&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;1248&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;520&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;920&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;top&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;928&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bottom&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;1120&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n36&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;결과를 보면 두 메소드 모두 같은 좌표 값을 리턴해준다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n37&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;p cid=&quot;n38&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;다음 테스트로 &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;window 와 screen 이 크기가 다른 경우&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;를 보기 위해&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n39&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;button 의 크기만을 window 로 가지는 custom dialog 를 만들어 테스트 해보았다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n40&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;로그를 찍는 코드는 위와 동일하다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n41&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;window&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;64&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;64&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loc&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;on&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;screen&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;520&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;1136&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;btn&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;left&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;right&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;400&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;top&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bottom&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;192&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n42&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;두 메소드가 다른 좌표값을 리턴해주는 것을 확인할 수 있다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n43&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;getLocationOnScreen() 은 기존과 유사한 좌표값을 주지만 getLoccationInWindow() 는 생성된 custom dialog 의 window 영역 내에서 view 좌표 값을 리턴해준다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n44&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;마찬가지로, left/right/top/bottom 값도 부모 뷰의 크기 변화에 따라 값이 달라진 것을 알 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;h4 cid=&quot;n45&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;위 내용을 토대로 Window 와 Screen 의 차이를 이해하고 상황에 맞는 메소드를 쓰도록 해보자&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/Android</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/116</guid>
      <comments>https://dwenn.tistory.com/116#entry116comment</comments>
      <pubDate>Sun, 19 Jan 2020 17:00:18 +0900</pubDate>
    </item>
    <item>
      <title>[Android] Architecture Components 사용 시의 5가지 일반적인 실수</title>
      <link>https://dwenn.tistory.com/114</link>
      <description>&lt;h1 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Architecture Components 사용 시의 5가지 일반적인 실수&lt;/span&gt;&lt;/h1&gt;&lt;blockquote cid=&quot;n2&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n3&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;주의 :&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 이 글은 원문이 존재하는 글로, 본인은 그저 번역 / 의역한 것일뿐임을 알림.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote cid=&quot;n4&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n5&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;원문 : &lt;/span&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://proandroiddev.com/5-common-mistakes-when-using-architecture-components-403e9899f4cb&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://proandroiddev.com/5-common-mistakes-when-using-architecture-components-403e9899f4cb&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n6&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;다소 심각한 결과를 초래하는 것들 - 만약 당신이 이러한 실수들을 저지르지 않더라도, 언젠가 같은 문제에 직면하는 것을 피하기 위해 명심할 가치가 있다. 이 글을 아래의 내용들을 설명한다.&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot;ul-list&quot; cid=&quot;n7&quot; mdtype=&quot;list&quot; data-mark=&quot;-&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; padding-left: 30px; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n8&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n9&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Leaking LiveData observers in Fragments&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n10&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n11&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Reloading data after every rotation&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n12&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n13&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Leaking ViewModels&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n14&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n15&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Exposing LiveData as mutable to Views&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n16&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n17&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Creating ViewModel's dependencies after every configuration change&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p cid=&quot;n18&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n19&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;1. Leaking LiveData observers in Fragments&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n20&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;fragment 는 까다로운 lifecycle 을 가지고 있고 fragment 가 detach 또는 re-attach 될 때 항상 실제로 파괴되지 않는다. 예로, configuration change 가 발생하는 동안 Fragment 는 파괴되지 않는다.configuration change 동안 fragment 의 instance 는 살아남고 오직 view 만 파괴된다. 따라서 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;onDestroy()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 는 호출되지 않고 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;DESTROYED&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 상태에 도달하지 않는다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n21&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이 문제는 우리가 LiveData 를 아래와 같이  &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;onCreateView()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 에서 옵저빙을 시작하거나, ( 때떄로 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;onActivityCreated()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 에서도 ) LifecycleOwner 로 fragment 를 전달할 때 발생한다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n22&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;BooksFragment&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Fragment&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;lateinit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;BooksViewModel&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onCreateView&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;inflater&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LayoutInflater&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;container&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewGroup&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;View&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;inflater&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;inflate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;fragment_books&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;container&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onActivityCreated&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;onActivityCreated&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModelProviders&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;BooksViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;java&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Risky: Passing Fragment as LifecycleOwner&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;liveData&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;observe&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Observer&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;updateViews&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) }) &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  ...&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n23&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;fragment 의 LifecycleOwner 가 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;DESTROYED&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 상태에 도달하지 않았기 때문에 기존의 observer instance 를 제거하기도 전에 fragment 가 re-attach 될 때마다 observer 의 새로운 instance 를 전달할 것이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n24&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;결국 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;onChange()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 에서 같은 시점, 같은 코드에서 활성화되어 여러번 실행되는 옵저버의 수가 늘어나는 결과를 초래한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n25&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;해당 이슈는 본래 &lt;/span&gt;&lt;span md-inline=&quot;link&quot; class=&quot; md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a spellcheck=&quot;false&quot; href=&quot;https://github.com/android/architecture-components-samples/issues/47&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;여기&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;에 보고되었으며, 더 자세한 설명은 &lt;/span&gt;&lt;span md-inline=&quot;link&quot; class=&quot; md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a spellcheck=&quot;false&quot; href=&quot;https://medium.com/@BladeCoder/architecture-components-pitfalls-part-1-9300dd969808&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;여기&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;에서 찾을 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n26&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;권장 솔루션은 support library 28.0.0, AndroidX 1.0.0 에 추가된 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;getViewLifecycleOwner()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 또는 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;getViewLifecycleOwnerLiveData()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 통해 fragment 의 view lifecycle 을 사용하는 것이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n27&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그렇게 함으로 LiveData 는 fragment 의 view 가 파괴될 때마다 observer 를 제거할 것이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n28&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n29&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;2. Reloading data after every rotation&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n30&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;우리는 Activity 의 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;onCreate()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 혹은 Fragment 의 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;onCreateView()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 메소드에 초기화 로직을 배치한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n31&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그렇기에 그 시점에 ViewModel 의 데이터를 불러와 연결하는것이 매력적으로 느껴질 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n32&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;하지만 당신의 코드에 따라, ViewModel 이 사용되고 있음에도 화면이 회전될 때마다 데이터가 다시 로드 될 가능성이 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n33&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그것은 대부분이 무의미하고 의도하지 않은 작업일 것이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n34&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;예제 : &lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n35&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;ProductViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductRepository&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;productDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Resource&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductDetails&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;specialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Resource&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;SpecialOffers&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;getProductsDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Resource&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductDetails&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Loading ProductDetails from network/database&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getProductDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Getting ProductDetails from repository and updating productDetails LiveData&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  ... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;productDetails&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;loadSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Loading SpecialOffers from network/database&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Getting SpecialOffers from repository and updating specialOffers LiveData&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  ... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;ProductActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AppCompatActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;lateinit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;productViewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductViewModelFactory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModelProviders&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;productViewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;java&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// (probable) Reloading product details after every rotation&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getProductsDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;observe&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Observer&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;/*...*/&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; }) &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// (probable) Reloading special offers after every rotation&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loadSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n36&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이 해결방안 역시 당신의 코드에 따라 다르다. 예제로 보면, repository 가 데이터를 캐싱하는 경우에 위 코드는 정상일 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n37&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;다른 해결방안은 아래와 같다.&lt;/span&gt;&lt;/p&gt;&lt;ul class=&quot;ul-list&quot; cid=&quot;n38&quot; mdtype=&quot;list&quot; data-mark=&quot;-&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; padding-left: 30px; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n39&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n40&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;LiveData 와 비슷한 &lt;/span&gt;&lt;span md-inline=&quot;link&quot; class=&quot; md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a spellcheck=&quot;false&quot; href=&quot;https://github.com/android/architecture-components-samples/blob/master/GithubBrowserSample/app/src/main/java/com/android/example/github/util/AbsentLiveData.kt&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;AbsentLiveData&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 사용, 데이터가 세팅되지 않았을 경우에만 로딩을 시작&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n41&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n42&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;OnClickListener 에서 실제로 데이터가 필요한 경우에만 로딩을 시작&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n43&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n44&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;제일 간단한 방법으로, ViewModel 의 초기화 시점에 로딩을 하고 getter 로 LiveData 를 제공&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n45&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;ProductViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductRepository&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;productDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Resource&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductDetails&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;specialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Resource&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;SpecialOffers&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;init&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// ViewModel is created only once during Activity/Fragment lifetime&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loadProductsDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// private, just utility method to be invoked in constructor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;loadProductsDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Loading ProductDetails from network/database&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getProductDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Getting ProductDetails from repository and updating productDetails LiveData&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  ... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// public, intended to be invoked by other classes when needed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;loadSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Loading SpecialOffers from network/database&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Getting SpecialOffers from repository and updating _specialOffers LiveData&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  ... &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Simple getter&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;getProductDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Resource&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductDetails&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;productDetails&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Simple getter&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;getSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Resource&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;SpecialOffers&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;specialOffers&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;ProductActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AppCompatActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;lateinit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;productViewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductViewModelFactory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModelProviders&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;productViewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ProductViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;java&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Just setting observer&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getProductDetails&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;observe&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Observer&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;/*...*/&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; }) &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Just setting observer&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;observe&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Observer&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;/*...*/&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; }) &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;button_offers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;setOnClickListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loadSpecialOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n46&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n47&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;3. Leaking ViewModels&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n48&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;ViewModel 에 view 참조를 전달하지 말라는것은 이미 강조되어 왔다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n49&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n50&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;주의 : ViewModel 은 activity context 를 가질 수 있는 view, lifecycle 또는 class 를 절대 참조해서는 안 된다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n51&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;하지만 우리는 다른 class 들에 ViewModel 의 참조를 전달하는 것 또한 조심해야한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n52&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;activity 혹은 fragment 가 종료될 때, activity 보다 오래 살아남을 수 있는 어떤 객체에서도 ViewModel 이 참조되어서는 안되며, ViewModel 은 올바르게 가비지 콜렉팅 되어야 한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n53&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;아래 예제는 싱글톤 스코프 내에서 repository 에 ViewModel listener 를 전달한고 삭제하지 않는다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n54&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;@Singleton&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;LocationRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: ((&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Unit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;setOnLocationChangedListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Unit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onLocationUpdated&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MapViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AutoClearViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;liveData&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LocationRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LocationRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;init&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Risky: Passing listener (which holds reference to the MapViewModel)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;setOnLocationChangedListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// to singleton scoped LocationRepository&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;liveData&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n55&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;해결방안으로 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;onCleared()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 메소드를 이용하여 listener 를 제거하고 이를 repository 에 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;WeakReference&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 로 저장하며 LiveData 를 사용함으로 repository 와 ViewModel 간의 통신을 하는 것이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n56&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이를 통해 정학환 가비지 콜렉팅을 보장할 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n57&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;@Singleton&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;LocationRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: ((&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Unit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;setOnLocationChangedListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Unit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;removeOnLocationChangedListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;null&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onLocationUpdated&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;listener&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;invoke&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;location&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MapViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AutoClearViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;liveData&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LocationRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Location&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LocationRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;init&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Risky: Passing listener (which holds reference to the MapViewModel)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;setOnLocationChangedListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// to singleton scoped LocationRepository&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;liveData&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;it&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// GOOD: Listener instance from above and MapViewModel&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;onCleared&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; can now be garbage collected&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;removeOnLocationChangedListener&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  } &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n58&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n59&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;4. Exposing LiveData as mutable to views&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n60&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이건 버그는 아니지만 관심사 분리에 어긋난다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n62&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;fragment, activity 의 view 는 LiveData 와 그에 따른 자신의 상태를 업데이트 할 수 없어야 한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n65&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그것은 오직 ViewModel 의 책임이기 때문이다. view 들은 LiveData 를 단지 observe 할 수 있어야 한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n72&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그러므로 우리는 MutableLiveData 를 getter 혹은 베이킹 필드로 캡슐화하여 접근하여야 한다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n78&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;CatalogueViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// BAD: Exposing mutable LiveData&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;products&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Products&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// GOOD: Encapsulate access to mutable LiveData through getter&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;promotions&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Promotions&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;getPromotions&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Promotions&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;promotions&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// GOOD: Encapsulate access to mutable LiveData using backing property&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;_offers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MutableLiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Offers&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;offers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;LiveData&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Offers&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;_offers&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;loadData&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp;  &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Other classes can also set products value&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;products&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loadProducts&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Only CatalogueViewModel can set promotions value&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;promotions&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loadPromotions&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Only CatalogueViewModel can set offers value&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;_offers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;loadOffers&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n76&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n79&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;5. Creating ViewModel's dependencies after every configuration change&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n83&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span class=&quot;md-plain&quot; md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;ViewModel 은 화면 회전과 같은 configuration change 가 발생할 때 살아남기 때문에 &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n84&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;변경이 발생할 때마다 종속성을 생성하는 것은 중복되며, 특히 종속성 생성자에 로직이 있는 경우 의도하지 않은 결과를 야기한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n86&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;매우 명확히 들릴 수 있지만, ViewModelFactory 를 사용할 때 간과하기 쉬운 부분이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n88&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;ViewModel 은 대개 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;create()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 과 동일한 종속성을 가진다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n92&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;ViewModelProvider 는 ViewModelFactory 의 instance 가 아닌 ViewModel 의 instance 를 보존한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n94&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;아래의 코드를 보자.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n224&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;stringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;StringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;authorisationService&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AuthorisationService&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  ...&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// We need to create instances of below dependencies to create instance of MoviesViewModelFactory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MoviesViewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;( &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;stringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;StringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;authorisationService&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AuthorisationService&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModelProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Factory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// but this method is called by ViewModelProvider only if ViewModel wasn't already created&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModel&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;modelClass&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;stringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;authorisationService&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MoviesActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AppCompatActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;@Inject&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;lateinit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;viewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModelFactory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;lateinit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Called each time Activity is recreated&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) { &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;setContentView&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;activity_movies&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Creating new instance of MoviesViewModelFactory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;injectDependencies&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModelProviders&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;java&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  ...&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n98&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;매 번 configuration change 가 발생 시 우리는 새로운 ViewModelFactory instance 를 만들고 불필요한 새로운 종속성을 만들 것이다. &lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n229&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesRepository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;stringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;StringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;authorisationService&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AuthorisationService&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  ...&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MoviesViewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Passing Providers here &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Provider&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesRepository&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// instead of passing directly dependencies&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;stringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Provider&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;StringProvider&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;val&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;authorisationService&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Provider&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AuthorisationService&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModelProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Factory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// This method is called by ViewModelProvider only if ViewModel wasn't already created&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModel&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;modelClass&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;Class&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; { &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;repository&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(), &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Deferred creating dependencies only if new insance of ViewModel is needed&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;stringProvider&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(), &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;authorisationService&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  ) &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;T&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;MoviesActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;AppCompatActivity&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;@Inject&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;lateinit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;viewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModelFactory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;lateinit&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;override&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Bundle&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;onCreate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;savedInstanceState&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;setContentView&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;R&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;layout&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;activity_movies&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Creating new instance of MoviesViewModelFactory&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;injectDependencies&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;ViewModelProviders&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;viewModelFactory&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MoviesViewModel&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;java&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  }&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt; &amp;nbsp;  ...&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;div&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/Android</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/114</guid>
      <comments>https://dwenn.tistory.com/114#entry114comment</comments>
      <pubDate>Sun, 20 Oct 2019 18:43:43 +0900</pubDate>
    </item>
    <item>
      <title>[Java] String.contains() with empty String, return true</title>
      <link>https://dwenn.tistory.com/113</link>
      <description>&lt;h1 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;String.contains() with empty String, return true&lt;/span&gt;&lt;/h1&gt;&lt;p cid=&quot;n2&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;java 에서 String.contains() 를 사용할 때 내가 발생했던 이슈에 대해 다뤄보려한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n3&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;아래의 코드를 보자.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n4&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;myString1&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;foo&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;myString2&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;myString1&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;contains&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;myString2&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)){&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;Am here&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;} &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;System&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;out&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;Am not here&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n5&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;foo 가 &quot;&quot; ( empty string  ) 을 포함하냐는 것인데, 언뜻 보면 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;false&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 로 &quot;Am not here&quot; 가 실행될 것 같지만&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n6&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;컴파일 해보면 &quot;Am here&quot; 가 출력된다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n7&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그 이유를 찾아보니 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;모든 문자열의 시작과 끝에는 공백 character 가 존재하기 때문&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이라고 한다. &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n8&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이러한 이유로 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;String.contains(), String.indexOf() 를 빈 문자열과 같이 사용할 경우 원치 않는 결과를 발생 시킬 수 있다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n9&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n10&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;References&lt;/span&gt;&lt;/h2&gt;&lt;blockquote cid=&quot;n11&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n12&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://stackoverflow.com/questions/24007818/why-string-contains-with-empty-string-returns-true/24007827&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://stackoverflow.com/questions/24007818/why-string-contains-with-empty-string-returns-true/24007827&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n13&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://jeeva-paramasamy.blogspot.com/2012/04/contains-and-indexof-in-java-will.html&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://jeeva-paramasamy.blogspot.com/2012/04/contains-and-indexof-in-java-will.html&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n14&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link md-expand&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://stackoverflow.com/questions/18399189/why-does-contains-method-find-empty-string-in-non-empty-string-in-java&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://stackoverflow.com/questions/18399189/why-does-contains-method-find-empty-string-in-non-empty-string-in-java&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/Java</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/113</guid>
      <comments>https://dwenn.tistory.com/113#entry113comment</comments>
      <pubDate>Thu, 3 Oct 2019 17:29:13 +0900</pubDate>
    </item>
    <item>
      <title>[Android] Message.obtain() vs Handler.obtainMessage()</title>
      <link>https://dwenn.tistory.com/112</link>
      <description>&lt;h1 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Message.obtain() vs Handler.obtainMessage()&lt;/span&gt;&lt;/h1&gt;&lt;p cid=&quot;n2&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler 에 대해 찾다가 Message 객체를 얻어오는 두 메소드를 알게 되었다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n3&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p md-focus&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;두 메소드의 차이를 보려고 Android Developers 문서를 보았는데 둘 다 Global Message Pool 의 인스턴스를 반환한다고 명시되어 있었다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n4&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;무언가 다른 점이 있을것 같아 찾아본 내용들에 대해서 정리하고자 한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n5&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n6&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Message.obtain()&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n7&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Android Developers 에서 찾아보면 이렇게 정의되어있다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n8&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n9&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;obtain&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;kotlin&quot; cid=&quot;n10&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;fun&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;obtain&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(): &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;!&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n11&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Return a new Message instance from the global pool. Allows us to avoid allocating new objects in many cases.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n12&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;p cid=&quot;n13&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Global Message Pool&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 에서 새 Message 인스턴스를 반환한다. 많은 경우 새로운 객체의 할당을 피할 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;h4 cid=&quot;n14&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Global Message Pool&lt;/span&gt;&lt;/h4&gt;&lt;p cid=&quot;n15&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;나는 정의를 보면서 global message pool 이 무엇인지가 궁금했는데, Message.java 코드를 살펴보면 알 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n16&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPool&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Message pool&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MAX_POOL_SIZE&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;; &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Message pool max size&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;obtain&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;synchronized&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPoolSync&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPool&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPool&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPool&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPoolSize&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n17&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;코드를 보면 단순히 Message class 내의 재활용되는 정적 메시지 객체이다. &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n18&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그런데 13번 라인을 보면 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;sPool == null&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 일 때, 새 Message 객체를 생성하여 리턴하는데 일반적으로 알고있는 싱글턴과 다르게 설계되어있다. 이는 Message.recycle() 을 보면 알 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n19&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;* Return a Message instance to the global pool.  You MUST NOT touch&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;* the Message after calling this function -- it has effectively been&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;* freed.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;recycle&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;clearForRecycle&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;synchronized&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPoolSync&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPoolSize&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;MAX_POOL_SIZE&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPool&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPool&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sPoolSize&lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n20&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;위 메소드를 통해 메시지 인스턴스를 global message pool 에 되돌린다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n21&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;recycle()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 은  &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler.dispatchMessage(Message msg)&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 가 한 번 호출되고 난 뒤에 호출된다고 한다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n22&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n23&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler.dispatchMessage(Message msg)&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n24&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Looper.loop() 에서 MessageQueue 에서 Message 를 가져와 msg.target.dispatchMessage(msg) 를 호출하여 Message 를 처리한다. ( tartget = handler )&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n25&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;자세한 내용은 Handler, Looper 의 구조에 대해 추가 포스팅하려 한다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n26&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그럼 Message.obtain() 에 대해서 간략히 보았고 다음은 Handler.obtainMessage() 에 대해 보면서 서로 간 차이점을 점층적으로 분석해 보자.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n27&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n28&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler.obtainMessage()&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n29&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;마찬가지로 Android Developers 문서를 보자.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n30&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n31&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;obtainMessage&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n32&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;obtainMessage&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n33&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Returns a new &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; from the global message pool. More efficient than creating and allocating new instances. The retrieved message has its handler set to this instance (Message.target == this). If you don't want that facility, just call Message.obtain() instead.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n34&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-right: 0px; padding-bottom: 0px;&quot;&gt;&lt;p cid=&quot;n35&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Global Message Pool 에서 새 Message 를 반환한다. 새 인스턴스를 생성하고 할당하는 것 보다 더 효율적이다. 검색된 Message 에는 Message 의 Hander 가 설정되어있다. (Message.target == this) 만약 그것을 원하지 않는다면 Message.obtain() 을 대신 사용하라.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n36&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이것 또한 global message pool 에서 새 message 객체를 반환한다고 설명하고 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n37&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;코드 상에서 다른 점을 살펴보자.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n38&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;obtainMessage&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;obtain&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;h5 cid=&quot;n39&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler.obtainMessage() 에서 Message.obtain() 의 결과를 리턴하고 있는걸 볼 수 있다.&lt;/span&gt;&lt;/h5&gt;&lt;p cid=&quot;n40&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;this 로 Handler 자신을 파라미터로 넘겨주고 있는데, 이번에는 Message.obtain(Handelr handler) 의 코드를 보자.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n41&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;obtain&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Handler&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;h&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;obtain&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;target&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;h&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; class=&quot;cm-tab-wrap-hack&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n42&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Message.obtain() 으로 가져온 Message 객체에 target handler 를 전달 받은 handler 로 지정하는 것을 볼 수 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n43&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이 코드를 보고 나니 Android Developers 문서 설명이 이해가 된다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n44&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n45&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;검색된 Message 에는 Message 의 Handler 가 설정되어있다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n46&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;p cid=&quot;n47&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이제 알게된 내용을 정리해보자. &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Message.obtain(), Handler.obtainMessage() 모두 global Message Pool 에서 재활용 되는 새 Message 객체를 받아온다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n48&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;다른 점은 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Handler.obtainMessage() 는 호출하는 Handler 로 target hander 가 지정된 Message 객체가 반환&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 된다는 것이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n49&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h4 cid=&quot;n50&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그런데 target handler 가 지정되면 무엇이 다른거지 ?&lt;/span&gt;&lt;/h4&gt;&lt;p cid=&quot;n51&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;또 다시 구글링해보자.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n52&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;obtain obtainMessage 를 키워드로 검색해 보았지만 좋은 글은 찾지 못하였다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n53&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;http://spatula.net/mt/blog/2015/02/androids-messageobtain-vs-handlerobtainmessage-from-safeasynctask.html&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;http://spatula.net/mt/blog/2015/02/androids-messageobtain-vs-handlerobtainmessage-from-safeasynctask.html&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n54&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;분석해 놓은 글을 하나 찾았지만 명확히 이해가 되지 않았고 참고를 위해 적어 두어야겠다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n55&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;검색결과 많은 의견이 Handler.obtainMessage() 를 쓰라는 것이 많았다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n56&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이유에 대해서는 추후 더 조사해보도록 해야겠다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n57&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n58&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;References&lt;/span&gt;&lt;/h2&gt;&lt;blockquote cid=&quot;n59&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n60&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;http://androidxref.com/4.4.2_r1/xref/frameworks/base/core/java/android/os/Message.java#106&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;http://androidxref.com/4.4.2_r1/xref/frameworks/base/core/java/android/os/Message.java#106&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n61&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://developer.android.com/reference/kotlin/android/os/Message?hl=en#obtain()&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://developer.android.com/reference/kotlin/android/os/Message?hl=en#obtain()&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n62&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;http://spatula.net/mt/blog/2015/02/androids-messageobtain-vs-handlerobtainmessage-from-safeasynctask.html&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;http://spatula.net/mt/blog/2015/02/androids-messageobtain-vs-handlerobtainmessage-from-safeasynctask.html&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n63&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link md-expand&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://stackoverflow.com/questions/49940878/when-message-object-is-recycled-by-android-an-android-system/49941095&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://stackoverflow.com/questions/49940878/when-message-object-is-recycled-by-android-an-android-system/49941095&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/Android</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/112</guid>
      <comments>https://dwenn.tistory.com/112#entry112comment</comments>
      <pubDate>Thu, 3 Oct 2019 17:28:15 +0900</pubDate>
    </item>
    <item>
      <title>[Android] Handler ( sendMessage, post ) / runOnUiThread</title>
      <link>https://dwenn.tistory.com/111</link>
      <description>&lt;h1 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler ( sendMessage, post ) / runOnUiThread&lt;/span&gt;&lt;/h1&gt;&lt;blockquote cid=&quot;n2&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;ol class=&quot;ol-list&quot; cid=&quot;n114&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box; margin: 0px; padding-left: 30px; position: relative;&quot;&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n116&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n117&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler ( sendMessage, post )&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n120&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n118&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;runOnUiThread&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n123&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n121&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;References&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n10&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;안드로이드에서 Thread 를 Main Thread 로 이관하는 작업  도중 문득 Handler ( sendMessage, post ) / runOnUiThread 의 차이점이 궁금해져서 찾아보았다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n11&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;각각의 사용법에 대해서는 잘 정리해놓은 글들이 많이 있고 내용이 길어질 수 있으니 사용법 관련해서는 적지 않았다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n12&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n13&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler ( sendMessage, post )&lt;/span&gt;&lt;/h2&gt;&lt;h3 cid=&quot;n234&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;sendMessage()&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n15&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;boolean&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;sendMessage&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;msg&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sendMessageDelayed&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;msg&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n16&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler.java 내에 정의된 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;sendMessage()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 메소드이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n17&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;image&quot; data-src=&quot;https://t1.daumcdn.net/cfile/tistory/995676395C98FFC53F&quot; class=&quot;md-image md-img-loaded&quot; style=&quot;box-sizing: border-box; min-width: 10px; min-height: 10px; position: relative; word-break: break-all; font-family: monospace; vertical-align: top; display: inline-block; width: 699.2px;&quot;&gt;&lt;img referrerpolicy=&quot;no-referrer&quot; alt=&quot;img&quot; src=&quot;https://t1.daumcdn.net/cfile/tistory/995676395C98FFC53F&quot; style=&quot;box-sizing: border-box; border-width: 0px 4px 0px 2px; border-top-style: initial; border-right-style: solid; border-bottom-style: initial; border-left-style: solid; border-top-color: initial; border-right-color: transparent; border-bottom-color: initial; border-left-color: transparent; border-image: initial; vertical-align: middle; max-width: 100%; cursor: default; display: block; margin: auto;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n18&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;[ 출처 : &lt;/span&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://itmining.tistory.com/5&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://itmining.tistory.com/5&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; ]&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n19&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;sendMessage() 는 알다시피 위와 같이 처리된다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n20&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;잠깐 딴 소리 좀 하자면&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n21&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n22&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 0px; width: inherit; position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;msg&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(); &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// 내가 주로 사용하던 방식&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;msg&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;handler&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;obtainMessage&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(); &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// 예제에서 찾은 방식&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n23&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Message 객체 생성 시 나는 주로 1번 라인 방식으로 사용하였었는데&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n24&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;찾다보니 2번 라인의 방식으로 예제가 많이 나와있었다. 무엇이 다른가 하여 Android Devleopers 사이트에서 설명을 찾아보니&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n25&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;obtainMessage()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 는 Global Message Pool 에서 새 Message 객체를 반환하며, 새 인스턴스를 생성하고 할당하는 것보다 효율적이라고 한다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote cid=&quot;n26&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n27&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Message.obtain() vs Handler.obtainMessage()&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n28&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Handler.obtainMessage()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 는 자동으로 traget handler 가 호출하는 handler 로 정해지고&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n29&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Message.obtain()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 은 target handler 를 지정해주어야 한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n30&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;둘다 메시지 풀에서 객체를 가져온다는데 ??&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 이 내용은 따로 포스팅 해야겠다.&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n31&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그렇다면 post 메소드의 내부는 어떨까 ?&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n32&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n33&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;post()&lt;/span&gt;&lt;/h3&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n34&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;boolean&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;post&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Runnable&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;r&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;sendMessageDelayed&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getPostMessage&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;r&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;), &lt;/span&gt;&lt;span class=&quot;cm-number&quot; style=&quot;box-sizing: border-box; color: rgb(17, 102, 68); font-family: Terminal;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n35&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler.java 에 정의된 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;post()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 이다. &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n36&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;sendMessage()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 와 동일하게 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;sendMessageDelayed(Message, long)&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 호출하는 것을 볼 수 있다. Message 객체를 전달할 때 다른 것이 보이는데 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;getPostMessage()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 살펴보자.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n37&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;getPostMessage&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Runnable&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;r&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Message&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;obtain&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;callback&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;r&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;m&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n38&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Message.obtain() 으로 Message Pool 에서 메시지 객체를 가져오고&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n39&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;전달 받은 Runnable 객체를 콜백으로 등록한 뒤 해당 Message 객체를 리턴해준다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n40&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그렇다면 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;sendMessage()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 와 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;post()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 는  어떤 Message 객체를 쓰느냐의 차이가 있을 뿐, 내부적으로 동일하게 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;sendMessageDelayed(Message, long)&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 를 호출한다는 것을 알 수 있다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n41&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n42&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;runOnUiThread&lt;/span&gt;&lt;/h2&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n43&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;runOnUiThread&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Runnable&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;action&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; (&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Thread&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;currentThread&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;mUiThread&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;mHandler&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;post&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;action&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;} &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;action&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;run&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n44&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Activity.java 내에 정의된 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;runOnUiThread()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 메소드이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n45&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;만약 &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;현재 Thread 가 UI Thread 가 아니면&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;, handler 의 post 를 실행하고&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n46&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;현재 Thread 가 UI Thread 라면&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;, 전달받은 Runnable 작업을 실행, run() 시켜준다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n47&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Handler&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;mHandler&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Handler&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n48&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Handler 는 위와 같이 전역 변수 final 로 관리되고 있고&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n49&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;mUiThread&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Thread&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;currentThread&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(); &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// Thread mUiThread&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n50&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;mUiThread 는 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Activity.attach()&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 에서 이처럼 초기화 된다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n51&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;결국 runOnUiThread 는 Handler.post() 로 동작한다는걸 알 수 있다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n52&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;h2 cid=&quot;n53&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;References&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;p cid=&quot;n295&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n54&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left: 4px solid rgb(223, 226, 229); padding: 0px 15px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;&quot;&gt;&lt;p cid=&quot;n55&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-p&quot; style=&quot;box-sizing: border-box; line-height: inherit; orphans: 4; margin: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://sdw8001.tistory.com/119&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://sdw8001.tistory.com/119&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/Android</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/111</guid>
      <comments>https://dwenn.tistory.com/111#entry111comment</comments>
      <pubDate>Thu, 3 Oct 2019 17:26:53 +0900</pubDate>
    </item>
    <item>
      <title>DI : Dependency Injection ( 의존성 주입 )</title>
      <link>https://dwenn.tistory.com/110</link>
      <description>&lt;h1 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;DI : Dependency Injection ( 의존성 주입 )&lt;/span&gt;&lt;/h1&gt;&lt;blockquote cid=&quot;n2&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;ol class=&quot;ol-list&quot; cid=&quot;n57&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box; margin: 0px; padding-left: 30px; position: relative;&quot;&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n58&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n59&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;What is DI ?&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n62&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n60&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;References&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n55&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n3&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;What is DI ?&lt;/span&gt;&lt;/h2&gt;&lt;p cid=&quot;n4&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;의존성 주입을 이해하기 위해 의존성의 개념부터 짚고 가겠다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n309&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n5&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Dependency ( 의존성 ) ?&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n6&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;SOLID 에서 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Dependency Inversion Principle ( DIP, 의존 관계 역전 원칙 )&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 을 이해하고 있다면 의존성을 이해하기 쉽다. DIP 에 대해서는 추후 포스팅 할 예정이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n7&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;DIP 는 이렇게 정의하고 있다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n8&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;ol class=&quot;ol-list&quot; start=&quot;&quot; cid=&quot;n9&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box; margin: 0px 0px 0.8em; padding-left: 30px; position: relative;&quot;&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n10&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n11&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;고차원의 모듈&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;은 &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;저차원의 모듈&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;에 의존하면 안 된다. 이 두 모듈 모두 다른 추상화 된 것에 의존해야 한다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n12&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n13&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;추상화 된 것은 구체적인 것에 의존하면 안 된다. 구체적인 것이 추상화 된 것에 의존해야 한다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p cid=&quot;n14&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;고수준 모듈&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; : 어떤 의미가 있는 단일 기능을 제공하는 모듈&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n15&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;저수준 모듈&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; : 고수준 모듈의 기능을 구현하기 위해 필요한 하위 기능을 실제로 구현한 것&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n16&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;말이 어려우니 예제 코드로 살펴보자. ( 출처 : &lt;/span&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;http://wonwoo.ml/index.php/post/1717&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;http://wonwoo.ml/index.php/post/1717&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; )&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n17&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;아래 예제는 어떤 바이트 데이터를 읽어와 특정한 데이터로 결과를 반환 하는 예제이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n18&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;여기서 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;고수준 모듈&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;은 &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;바이트 데이터를 읽어와 특정한 데이터로 결과를 반환하는 것&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n19&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그리고 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;저수준 모듈&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;은 &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;파일에서 바이트 데이터를 읽어오고, Json 데이터로 겨로가를 반환하는 것&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이다.&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n20&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 1em 6px 0px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;/*&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;고수준 모듈&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;Response&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;JsonConverter&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;jsonConverter&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;JsonConverter&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;response&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;byte&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[] &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bytes&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-atom&quot; style=&quot;box-sizing: border-box; color: rgb(34, 17, 153); font-family: Terminal;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;jsonConverter&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bytes&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span cm-text=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;/*&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;저수준 모듈&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;JsonConverter&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;convert&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;byte&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;[] &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;bytes&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-comment&quot; style=&quot;box-sizing: border-box; color: rgb(170, 85, 0); font-family: Terminal;&quot;&gt;// json converting ...&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;json txt&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n21&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;고수준 모듈인 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Response&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 가 저수준 모듈인 &lt;/span&gt;&lt;span md-inline=&quot;code&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;code style=&quot;box-sizing: border-box; font-family: var(--monospace); vertical-align: initial; border: 1px solid rgb(231, 234, 237); background-color: rgb(243, 244, 244); border-radius: 3px; padding: 0px 2px; font-size: 0.9em;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;JsonConverter&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 의 구현에 의존되고 있다.&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 즉, DIP 원칙을 어기고 있다. &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n22&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이를 해결하기 위한 DI 는 계속해서 설명하기로 하고 먼저,&lt;/span&gt;&lt;/p&gt;&lt;h4 cid=&quot;n23&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.4; cursor: text; white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;의존성 ( Dependency ) 가 위험한 이유에 대해서 알고 가자.&lt;/span&gt;&lt;/h4&gt;&lt;ol class=&quot;ol-list&quot; start=&quot;&quot; cid=&quot;n24&quot; mdtype=&quot;list&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; padding-left: 30px; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n25&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n26&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;하나의 모듈이 바뀌면 의존한 다른 모듈까지 변경이 이루어지기 때문&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;md-list-item&quot; cid=&quot;n27&quot; mdtype=&quot;list_item&quot; style=&quot;box-sizing: border-box; margin: 0px; position: relative;&quot;&gt;&lt;p cid=&quot;n28&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.5rem; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;테스트 가능한 어플을 만들 때 의존성이 있으면 유닛 테스트 작성이 어렵다&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n29&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.5rem 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;( 유닛 테스트의 목적 자체가 다른 모듈로부터 독립적으로 테스트하는 것을 요구하기 때문에 )&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p cid=&quot;n30&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h3 cid=&quot;n31&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.5em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.43; cursor: text; white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;DI ?&lt;/span&gt;&lt;/h3&gt;&lt;p cid=&quot;n32&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이제 저런 의험성을 없애기 위해 DI 가 필요하다는 것 까지 이해가 되었다. &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n33&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그렇다면 DI 의 정의는 무엇일까 ?&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n34&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n35&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;프로그래밍에서 구성요소간의 의존 관계가 소스코드 내부가 아닌 외부의 설정 파일 등을 통해 정의되게 하는 디자인 패턴 중 하나.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n36&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;[ 출처 : &lt;/span&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EC%9D%98%EC%A1%B4%EC%84%B1_%EC%A3%BC%EC%9E%85&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://ko.wikipedia.org/wiki/%EC%9D%98%EC%A1%B4%EC%84%B1_%EC%A3%BC%EC%9E%85&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; ]&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n37&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;위 링크를 타고 가보면 UML 로 간단히 정리가 되어있지만, 나는 UML 과 친숙하지 않아서 예제 코드로 이해했다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n38&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;위키에서 설명하는 DI 의 이점으로 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;모듈간의 결합도 저하, 코드의 재사용성, 단위 테스트의 편의성 향상&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 등이 있다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n39&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;또한, DI 의 적용 유형으로 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;생성자 주입, 세터를 통한 주입, 인터페이스를 통한 주입&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;을 제시하였다. 이 내용은 위키에 잘 나와있으니 링크를 통해 참고하자.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n40&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;그럼 아래의 예제 코드를 부며 DI 를 이해해 보자.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n63&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://faith-developer.tistory.com/147&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://faith-developer.tistory.com/147&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n66&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Dagger 에서도 사용하고 있는 Coffee Maker 예제라고 한다. 이 예제를 보면 알 수 있듯이, DI 의 핵심은 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;의존성 주입으로 인한 모듈간 결합도 저하&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; 이다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n75&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-focus&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n46&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;References&lt;/span&gt;&lt;/h2&gt;&lt;blockquote cid=&quot;n47&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n48&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://gmlwjd9405.github.io/2018/11/09/dependency-injection.html&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://gmlwjd9405.github.io/2018/11/09/dependency-injection.html&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n49&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://faith-developer.tistory.com/147&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://faith-developer.tistory.com/147&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n50&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://tony-programming.tistory.com/entry/Dependency-%EC%9D%98%EC%A1%B4%EC%84%B1-%EC%9D%B4%EB%9E%80&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://tony-programming.tistory.com/entry/Dependency-%EC%9D%98%EC%A1%B4%EC%84%B1-%EC%9D%B4%EB%9E%80&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n51&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;http://wonwoo.ml/index.php/post/1717&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;http://wonwoo.ml/index.php/post/1717&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n52&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-top: 0.8em; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;autolink&quot; class=&quot;md-link&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://ko.wikipedia.org/wiki/%EC%9D%98%EC%A1%B4%EC%84%B1_%EC%A3%BC%EC%9E%85&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://ko.wikipedia.org/wiki/%EC%9D%98%EC%A1%B4%EC%84%B1_%EC%A3%BC%EC%9E%85&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/프로그래밍</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/110</guid>
      <comments>https://dwenn.tistory.com/110#entry110comment</comments>
      <pubDate>Mon, 16 Sep 2019 22:53:29 +0900</pubDate>
    </item>
    <item>
      <title>[Java] JDK 6 이후, Timezone.setDefault()</title>
      <link>https://dwenn.tistory.com/108</link>
      <description>&lt;h1 cid=&quot;n0&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 2.25em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.2; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;JDK 6 이후, Timezone.setDefault() &lt;/span&gt;&lt;/h1&gt;&lt;p cid=&quot;n2&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;Timezone.setDefault(Timzone timezone)&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;  은 메소드 명에서 유추할 수 있듯이 기본 Timezone 값을 설정하는 메소드이다.&lt;/span&gt;&lt;/p&gt;&lt;blockquote cid=&quot;n3&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n4&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Timezone.getDefault() // 기본 Timezone 값 가져오기&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p cid=&quot;n5&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;먼저 핵심부터 이야기하면, &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;JDK 6 이전&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;에는 defaultTimzone 이 &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;스레드 로컬 변수에 저장&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;되었다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n6&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;하지만 &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;JDK 6 이후&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;로는 defaultTimezone 이 &lt;/span&gt;&lt;span md-inline=&quot;strong&quot; class=&quot;&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;VM 전체를 변경&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;한다고 한다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n7&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;p cid=&quot;n8&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block md-focus&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; class=&quot;md-expand&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;내 경우에는 JDK 6 이전의 형태로만 알고 있었기 때문에, &lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n9&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;Timezone 설정을 아래와 같이, 별도의 시간 관련 메소드 내에서 Timezone.setDefault(Timzone timezone) 을 사용하여 Timezone 설정을 간략화 해두었었다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n10&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;( Calendar 객체를 가져오거나 SimpleDateFormat 에 timezone 을 설정하지 않고 )&lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n11&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 1em 6px 0px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable-3&quot; style=&quot;box-sizing: border-box; color: rgb(0, 136, 85); font-family: Terminal;&quot;&gt;boolean&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-def&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 255); font-family: Terminal;&quot;&gt;checkDate&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-tab&quot; role=&quot;presentation&quot; cm-text=&quot;	&quot; style=&quot;box-sizing: border-box; font-family: Terminal; position: relative; display: inline-block;&quot;&gt;    &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;TimeZone&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;setDefault&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;TimeZone&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getTimeZone&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;GMT&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;));&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Calendar&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;calendar&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Calendar&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getInstance&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;SimpleDateFormat&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;dateFormat&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-operator&quot; style=&quot;box-sizing: border-box; color: rgb(152, 26, 26); font-family: Terminal;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-keyword&quot; style=&quot;box-sizing: border-box; color: rgb(119, 0, 136); font-family: Terminal;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;SimpleDateFormat&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;yyyyMMdd&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px; font-family: Terminal;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n12&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;p cid=&quot;n13&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;하지만 문제가 발생한 것이, 다른 시간대를 가져와서 비교를 하는 로직이 있었는데&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n14&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;( 위의 메소드가 사용되는 곳과 전혀 다른 곳 - &lt;/span&gt;&lt;span md-inline=&quot;underline&quot; style=&quot;box-sizing: border-box;&quot;&gt;&lt;u style=&quot;box-sizing: border-box;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;다른 Activity, 다른 프로세스&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt; ) &lt;/span&gt;&lt;/p&gt;&lt;pre spellcheck=&quot;false&quot; class=&quot;md-fences md-end-block md-fences-with-lineno ty-contain-cm modeLoaded&quot; lang=&quot;java&quot; cid=&quot;n15&quot; mdtype=&quot;fences&quot; style=&quot;box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; break-inside: avoid; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 1em 6px 0px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); position: relative !important;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span role=&quot;presentation&quot; style=&quot;box-sizing: border-box; padding-right: 0.1px;&quot;&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;Calendar&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;cm-variable&quot; style=&quot;box-sizing: border-box; color: rgb(0, 0, 0); font-family: Terminal;&quot;&gt;getInstance&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;cm-string&quot; style=&quot;box-sizing: border-box; color: rgb(170, 17, 17); font-family: Terminal;&quot;&gt;&quot;Asia/Seoul&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p cid=&quot;n16&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;위 처럼 Asia/Seoul 의 Timezone 을 명시하여도 GMT 시간으로 가져오는 문제가 발생하였다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n17&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;이것 때문에 한참 골머리 썪었었는데, 다행히도 참고한 글을 발견하고 해결하였다.&lt;/span&gt;&lt;/p&gt;&lt;p cid=&quot;n18&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin: 0.8em 0px; white-space: pre-wrap; width: inherit; position: relative; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;/p&gt;&lt;h2 cid=&quot;n19&quot; mdtype=&quot;heading&quot; class=&quot;md-end-block md-heading&quot; style=&quot;box-sizing: border-box; break-after: avoid-page; break-inside: avoid; font-size: 1.75em; margin-top: 1rem; margin-bottom: 1rem; position: relative; line-height: 1.225; cursor: text; padding-bottom: 0.3em; border-bottom: 1px solid rgb(238, 238, 238); white-space: pre-wrap; width: inherit; color: rgb(51, 51, 51); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span md-inline=&quot;plain&quot; style=&quot;box-sizing: border-box; font-family: Terminal;&quot;&gt;References&lt;/span&gt;&lt;/h2&gt;&lt;blockquote cid=&quot;n20&quot; mdtype=&quot;blockquote&quot; style=&quot;box-sizing: border-box; margin: 0.8em 0px; border-left-width: 4px; border-left-color: rgb(223, 226, 229); padding-top: 0px; padding-bottom: 0px; color: rgb(119, 119, 119); font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Clear Sans&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif;&quot;&gt;&lt;p cid=&quot;n21&quot; mdtype=&quot;paragraph&quot; class=&quot;md-end-block&quot; style=&quot;box-sizing: border-box; orphans: 4; margin-right: 0px; margin-left: 0px; white-space: pre-wrap; position: relative;&quot;&gt;&lt;span md-inline=&quot;url&quot; class=&quot;md-link&quot; spellcheck=&quot;false&quot; style=&quot;box-sizing: border-box; word-break: break-all;&quot;&gt;&lt;a href=&quot;https://codeday.me/ko/qa/20190508/489138.html&quot; style=&quot;box-sizing: border-box; cursor: pointer; color: rgb(65, 131, 196); -webkit-user-drag: none;&quot;&gt;&lt;span style=&quot;font-family: Terminal;&quot;&gt;https://codeday.me/ko/qa/20190508/489138.html&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>프로그래밍/Java</category>
      <author>DwEnn</author>
      <guid isPermaLink="true">https://dwenn.tistory.com/108</guid>
      <comments>https://dwenn.tistory.com/108#entry108comment</comments>
      <pubDate>Sun, 25 Aug 2019 12:12:01 +0900</pubDate>
    </item>
  </channel>
</rss>