<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://www.typea.info/tips_/index.php?action=history&amp;feed=atom&amp;title=Android_Fragment</id>
	<title>Android Fragment - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://www.typea.info/tips_/index.php?action=history&amp;feed=atom&amp;title=Android_Fragment"/>
	<link rel="alternate" type="text/html" href="https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;action=history"/>
	<updated>2026-04-21T04:37:15Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.34.0</generator>
	<entry>
		<id>https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=5709&amp;oldid=prev</id>
		<title>2020年2月16日 (日) 04:21にPirotoによる</title>
		<link rel="alternate" type="text/html" href="https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=5709&amp;oldid=prev"/>
		<updated>2020-02-16T04:21:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;amp;diff=5709&amp;amp;oldid=4667&quot;&gt;差分を表示&lt;/a&gt;</summary>
		<author><name>Piroto</name></author>
		
	</entry>
	<entry>
		<id>https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=4667&amp;oldid=prev</id>
		<title>2020年2月15日 (土) 08:33にPirotoによる</title>
		<link rel="alternate" type="text/html" href="https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=4667&amp;oldid=prev"/>
		<updated>2020-02-15T08:33:40Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年2月15日 (土) 08:33時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;1行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; | &lt;/del&gt;[[Android]] | [[Android Tips]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Android]] | [[Android Tips]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;| &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Piroto</name></author>
		
	</entry>
	<entry>
		<id>https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=4423&amp;oldid=prev</id>
		<title>2020年2月15日 (土) 08:30にPirotoによる</title>
		<link rel="alternate" type="text/html" href="https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=4423&amp;oldid=prev"/>
		<updated>2020-02-15T08:30:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年2月15日 (土) 08:30時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;1行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Android]][[Android Tips]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; | &lt;/ins&gt;[[Android]] &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;| &lt;/ins&gt;[[Android Tips]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Piroto</name></author>
		
	</entry>
	<entry>
		<id>https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=3926&amp;oldid=prev</id>
		<title>2020年2月15日 (土) 08:17にPirotoによる</title>
		<link rel="alternate" type="text/html" href="https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=3926&amp;oldid=prev"/>
		<updated>2020-02-15T08:17:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年2月15日 (土) 08:17時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;1行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Android][Android Tips]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Android]&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;][&lt;/ins&gt;[Android Tips]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Piroto</name></author>
		
	</entry>
	<entry>
		<id>https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=2930&amp;oldid=prev</id>
		<title>2020年2月15日 (土) 08:00にPirotoによる</title>
		<link rel="alternate" type="text/html" href="https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=2930&amp;oldid=prev"/>
		<updated>2020-02-15T08:00:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ja&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;2020年2月15日 (土) 08:00時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;1行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;1行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Android Fragment==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[Android][Android Tips]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;[Android][Android Tips&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*http://developer.android.com/guide/components/fragments.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l10&quot; &gt;10行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;10行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*フラグメントをアクティビティレイアウトの一部に追加すると、アクティビティのビュー階層のViewGroup の中で、自分のビューレイアウトを定義し生存する&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*フラグメントをアクティビティレイアウトの一部に追加すると、アクティビティのビュー階層のViewGroup の中で、自分のビューレイアウトを定義し生存する&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*アクティビティレイアウトに、レイアウトファイルに&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;fragment&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;と宣言する、もしくはアプリケーションコードからViewGroupに追加することでことで挿入できる。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*アクティビティレイアウトに、レイアウトファイルに&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;fragment&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;と宣言する、もしくはアプリケーションコードからViewGroupに追加することでことで挿入できる。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*しかしながらフラグメントは、アクティビティレイアウトの一部であることは必須ではない。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*しかしながらフラグメントは、アクティビティレイアウトの一部であることは必須ではない。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*フラグメントを自身のUIを持たない、アクティビティのための不可視なワーカーとして使うこともできる&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*フラグメントを自身のUIを持たない、アクティビティのための不可視なワーカーとして使うこともできる&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l57&quot; &gt;57行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;57行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*戻りとして、フラグメントのルートとなるViewを返すように実装する。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*戻りとして、フラグメントのルートとなるViewを返すように実装する。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;blockquote&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;ListFragmentのサブクラスである場合、デフォルトの実装では、ListViewを返すため、実装する必要はない&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;/blockquote&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;blockquote&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;ListFragmentのサブクラスである場合、デフォルトの実装では、ListViewを返すため、実装する必要はない&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;/blockquote&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*onCreateView() からレイアウトを返すために、XMLで定義されたレイアウトリソースからViewを生成することができる。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*onCreateView() からレイアウトを返すために、XMLで定義されたレイアウトリソースからViewを生成することができる。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l86&quot; &gt;86行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;86行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====フラグメントをアクティビティレイアウトファイルの中で宣言====&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;====フラグメントをアクティビティレイアウトファイルの中で宣言====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;LinearLayout xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;LinearLayout xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      android:orientation=&amp;quot;horizontal&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      android:orientation=&amp;quot;horizontal&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      android:layout_width=&amp;quot;match_parent&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      android:layout_width=&amp;quot;match_parent&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      android:layout_height=&amp;quot;match_parent&amp;quot;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      android:layout_height=&amp;quot;match_parent&amp;quot;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;fragment android:name=&amp;quot;com.example.news.ArticleListFragment&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;fragment android:name=&amp;quot;com.example.news.ArticleListFragment&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:id=&amp;quot;@+id/list&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:id=&amp;quot;@+id/list&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_weight=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_weight=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_width=&amp;quot;0dp&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_width=&amp;quot;0dp&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_height=&amp;quot;match_parent&amp;quot; /&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_height=&amp;quot;match_parent&amp;quot; /&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;fragment android:name=&amp;quot;com.example.news.ArticleReaderFragment&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;fragment android:name=&amp;quot;com.example.news.ArticleReaderFragment&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:id=&amp;quot;@+id/viewer&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:id=&amp;quot;@+id/viewer&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_weight=&amp;quot;2&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_weight=&amp;quot;2&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_width=&amp;quot;0dp&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_width=&amp;quot;0dp&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_height=&amp;quot;match_parent&amp;quot; /&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;              android:layout_height=&amp;quot;match_parent&amp;quot; /&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;/LinearLayout&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;/LinearLayout&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;fragment&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt; &lt;/del&gt;の android:name 属性はレイアウトの中でインスタンス化するFragmentを特定する&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;fragment&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt; &lt;/ins&gt;の android:name 属性はレイアウトの中でインスタンス化するFragmentを特定する&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*システムがアクティビティレイアウトを生成するとき、それぞれのフラグメントをインスタンス化し、おんCreateView（）メソッドを呼び出す。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*システムがアクティビティレイアウトを生成するとき、それぞれのフラグメントをインスタンス化し、おんCreateView（）メソッドを呼び出す。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l186&quot; &gt;186行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;186行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*それに対して、addToBackStack()を呼び出した場合、フラグメントは停止され、ユーザーが戻る場合に、再開される。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*それに対して、addToBackStack()を呼び出した場合、フラグメントは停止され、ユーザーが戻る場合に、再開される。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;blockquote&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;それぞれのフラグメントトランザクションに、setTransaction() を コミット前に呼ぶことによって、トランザクションアニメーションを適用できる。&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;/blockquote&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;blockquote&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;それぞれのフラグメントトランザクションに、setTransaction() を コミット前に呼ぶことによって、トランザクションアニメーションを適用できる。&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;/blockquote&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*commit() を呼び出すことは、トランザクションを直ちに実行することではない。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*commit() を呼び出すことは、トランザクションを直ちに実行することではない。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*性格には、アクティビティのUIスレッドに直ちに実行するようにスケジュールする。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*性格には、アクティビティのUIスレッドに直ちに実行するようにスケジュールする。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l192&quot; &gt;192行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;192行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*通常これは、トランザクションが、他のスレッドに依存していないかぎり、必要ではない。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*通常これは、トランザクションが、他のスレッドに依存していないかぎり、必要ではない。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;blockquote&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;注意:commit()でトランザクションをコミットできるのは、アクティビティの保存時まで。この時点を過ぎてcommit()を試みると例外となる。なぜなら、コミット後の状態はアクティビティがリストアするときに失われてしまう&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;/blockquote&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;blockquote&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;注意:commit()でトランザクションをコミットできるのは、アクティビティの保存時まで。この時点を過ぎてcommit()を試みると例外となる。なぜなら、コミット後の状態はアクティビティがリストアするときに失われてしまう&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;/blockquote&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ため。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ため。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Piroto</name></author>
		
	</entry>
	<entry>
		<id>https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=1600&amp;oldid=prev</id>
		<title>Piroto: ページの作成:「==Android Fragment==  [Android][Android Tips]  *http://developer.android.com/guide/components/fragments.html    ===概要===  *複数のフラグメントを一つのア…」</title>
		<link rel="alternate" type="text/html" href="https://www.typea.info/tips_/index.php?title=Android_Fragment&amp;diff=1600&amp;oldid=prev"/>
		<updated>2020-02-15T07:30:11Z</updated>

		<summary type="html">&lt;p&gt;ページの作成:「==Android Fragment==  [Android][Android Tips]  *http://developer.android.com/guide/components/fragments.html    ===概要===  *複数のフラグメントを一つのア…」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Android Fragment==&lt;br /&gt;
[Android][Android Tips]&lt;br /&gt;
*http://developer.android.com/guide/components/fragments.html&lt;br /&gt;
&lt;br /&gt;
===概要===&lt;br /&gt;
*複数のフラグメントを一つのアクティビティに組み合わせて、マルチペインUIとし、フラグメントを複数のアクティビティで再利用できる&lt;br /&gt;
*フラグメントを自分自身のライフサイクルヲもつ、アクティビティのモジュールと見なすことができる。&lt;br /&gt;
*フラグメントは、それぞれ入力イベントを持ち、アクティビティが起動している間に追加したり取り除いたりできる。&lt;br /&gt;
*フラグメントは常にアクティビティに組み込まれ、ライフサイクルは、直接ホストしているアクティビティのライフサイクルの影響を受ける&lt;br /&gt;
&lt;br /&gt;
*フラグメントをアクティビティレイアウトの一部に追加すると、アクティビティのビュー階層のViewGroup の中で、自分のビューレイアウトを定義し生存する&lt;br /&gt;
*アクティビティレイアウトに、レイアウトファイルに&amp;lt;fragment&amp;gt;と宣言する、もしくはアプリケーションコードからViewGroupに追加することでことで挿入できる。&lt;br /&gt;
*しかしながらフラグメントは、アクティビティレイアウトの一部であることは必須ではない。&lt;br /&gt;
*フラグメントを自身のUIを持たない、アクティビティのための不可視なワーカーとして使うこともできる&lt;br /&gt;
&lt;br /&gt;
===デザイン===&lt;br /&gt;
*Androidでは、フラグメントをAndroid30(API Level11)で導入した。&lt;br /&gt;
*一義的には、タブレットなどの大画面でさらに動的で柔軟なUIデザインをサポートするため。&lt;br /&gt;
*タブレットのスクリーンは、ハンドセットと比較して十分に大きく、ユーザーとやりとりするUIコンポーネントのための場所が残されている。&lt;br /&gt;
*フラグメントはこのようなビュー階層の複雑な変更の管理が必要内容にデザインされている。&lt;br /&gt;
&lt;br /&gt;
*アクティビティレイアウトにフラグメントを投入することによって、レイアウトに起動中のアクティビティの表示やそれら変更の維持管理を変更できる様になる。&lt;br /&gt;
&lt;br /&gt;
*例えば、ニュースアプリケーションでは、一つのフラグメントに記事のリストを表示し左に配置し、もう一つのフラグメントに記事を表示し、右側に配置することができる。&lt;br /&gt;
*どちらのフラグメントも一つのアクティビティに並んで表示され、それぞれライフサイクルコールバックメソッドのセットを持ち、それぞれユーザーの入力イベントを処理する。&lt;br /&gt;
*言い換えれば、記事のリスト表示と記事を読むことを一つの同じアクティビティで行うことができるということ。&lt;br /&gt;
&lt;br /&gt;
*フラグメントを再利用可能なモジュールコンポーネントとしてデザインすべき。&lt;br /&gt;
*それぞれのフラグメントは、自分自身のレイアウトを定義し、それぞれの振る舞いを自身のライフサイクルコールバックに持つため。&lt;br /&gt;
*一つのフラグメントを複数のアクティビティに組み込むことができるので、再利用可能かつ、フラグメント間で、直接操作し合うことは行うべきではない。&lt;br /&gt;
*モジュール化されたフラグメントは、フラグメントの組合せを異なったスクリーンサイズにおいて可能にする&lt;br /&gt;
*アプリケーションにタブレットとハンドセットをサポートするようにデザインする場合、フラグメントを可能なスクリーンスペースに依存したユーザーエクスペリエンスに応じた、別のレイアウト定義に再利用できる。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===フラグメントの生成===&lt;br /&gt;
*フラグメントを生成するには、Fragment のサブクラスを作成する必要がある。&lt;br /&gt;
*Fragment クラスは、Activity によく似ている。&lt;br /&gt;
*アクティビティと同じく、onCreate(),onStart(),onPause,onStop()といったコールバックメソッドを持つ&lt;br /&gt;
*実際、既存のAndroidアプリケーションをフラグメントを利用するようにコンバートする場合、単純にアクティビティのコールバックメソッドをそれぞれフラグメントのメソッドに移動する。&lt;br /&gt;
*通常、少なくとも以下のライフサイクルメソッドを実装する&lt;br /&gt;
**onCreate():フラグメント生成時に呼ばれる。主要なコンポーネントの初期化、ポーズやストップから再開したときの処理を実装&lt;br /&gt;
**onCreateView():UIを最初に描画するときに呼ばれる。フラグメントのルートビューを返す。nullを返すとフラグメントはUIを提供しない&lt;br /&gt;
**onPause():ユーザーがフラグメントから離れた時に呼び出される。&lt;br /&gt;
*多くのアプリケーションは、少なくとも上記の3つのメソッドを各フラグメントに実装するべきである。&lt;br /&gt;
*しかし、いくつか他のコールバックもフラグメントのライフサイクルで利用できる。&lt;br /&gt;
**http://developer.android.com/guide/components/fragments.html#Lifecycle&lt;br /&gt;
&lt;br /&gt;
*Fragmentクラスを継承する代わりに、いくつかのサブクラスを利用できる&lt;br /&gt;
**DialogFragment : フローティングダイアログ。アクティビティのダイアログヘルパーメソッドを利用するのの良い代替となる。&lt;br /&gt;
**ListFragment : アダプターにより管理されるアイテムをリストする。ListActivityと同様&lt;br /&gt;
**PreferenceFragment : Preference オブジェクトの階層をリストとして表示する。PreferenceActivityと同様&lt;br /&gt;
&lt;br /&gt;
===ユーザーインターフェースの追加===&lt;br /&gt;
*フラグメントは、通常アクティビティUIの一部として利用される。&lt;br /&gt;
*フラグメントにレイアウトを与えるには、onCreateView() コールバックメソッドを実装する。&lt;br /&gt;
*onCreateView() は、フラグメントがレイアウトを描画するタイミングで呼び出される。&lt;br /&gt;
*戻りとして、フラグメントのルートとなるViewを返すように実装する。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;ListFragmentのサブクラスである場合、デフォルトの実装では、ListViewを返すため、実装する必要はない&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*onCreateView() からレイアウトを返すために、XMLで定義されたレイアウトリソースからViewを生成することができる。&lt;br /&gt;
*それを助けるために、onCreateView() は LayoutInflater オブジェクトを提供する&lt;br /&gt;
&lt;br /&gt;
*example_fragment.xml ファイルから、レイアウトをロードする例&lt;br /&gt;
 public static class ExampleFragment extends Fragment {&lt;br /&gt;
     @Override&lt;br /&gt;
     public View onCreateView(LayoutInflater inflater, ViewGroup container,&lt;br /&gt;
                              Bundle savedInstanceState) {&lt;br /&gt;
         // Inflate the layout for this fragment&lt;br /&gt;
         return inflater.inflate(R.layout.example_fragment, container, false);&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
*container パラメータは、親のViewGroup(アクティビティレイアウトによる)。&lt;br /&gt;
*フラグメントは、container に挿入される。&lt;br /&gt;
*savedInstanceState パラメータは、Bundle で、以前のフラグメントインスタンスについてのデータを提供する。&lt;br /&gt;
&lt;br /&gt;
*inflate()メソッドは3つの引数をとる&lt;br /&gt;
**resourceID:生成したいレイアウトのリソースID&lt;br /&gt;
**ViewGroup:生成したレイアウトの親&lt;br /&gt;
**boolean:生成したレイアウトが、ViewGroupにアタッチされるべきか。&lt;br /&gt;
&lt;br /&gt;
===フラグメントをアクティビティに追加===&lt;br /&gt;
*通常、フラグメントはホストアクティビティの一部となる。&lt;br /&gt;
*アクティビティのレイアウトにフラグメントを追加するには2つの方法がある。&lt;br /&gt;
&lt;br /&gt;
====フラグメントをアクティビティレイアウトファイルの中で宣言====&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;LinearLayout xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
     android:orientation=&amp;quot;horizontal&amp;quot;&lt;br /&gt;
     android:layout_width=&amp;quot;match_parent&amp;quot;&lt;br /&gt;
     android:layout_height=&amp;quot;match_parent&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;fragment android:name=&amp;quot;com.example.news.ArticleListFragment&amp;quot;&lt;br /&gt;
             android:id=&amp;quot;@+id/list&amp;quot;&lt;br /&gt;
             android:layout_weight=&amp;quot;1&amp;quot;&lt;br /&gt;
             android:layout_width=&amp;quot;0dp&amp;quot;&lt;br /&gt;
             android:layout_height=&amp;quot;match_parent&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;fragment android:name=&amp;quot;com.example.news.ArticleReaderFragment&amp;quot;&lt;br /&gt;
             android:id=&amp;quot;@+id/viewer&amp;quot;&lt;br /&gt;
             android:layout_weight=&amp;quot;2&amp;quot;&lt;br /&gt;
             android:layout_width=&amp;quot;0dp&amp;quot;&lt;br /&gt;
             android:layout_height=&amp;quot;match_parent&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/LinearLayout&amp;gt;&lt;br /&gt;
*&amp;lt;fragment&amp;gt; の android:name 属性はレイアウトの中でインスタンス化するFragmentを特定する&lt;br /&gt;
*システムがアクティビティレイアウトを生成するとき、それぞれのフラグメントをインスタンス化し、おんCreateView（）メソッドを呼び出す。&lt;br /&gt;
&lt;br /&gt;
=====フラグメントID=====&lt;br /&gt;
*それぞれのフラグメントは一意のIDを要求する。それは、システムが、フラグメントをアクティビティが再開するときに、再構築するのに利用される。&lt;br /&gt;
*フラグメントにIDを与えるには3つの方法がある&lt;br /&gt;
**android:id 属性 を一意なIDとして与える&lt;br /&gt;
**android:tag 属性 を一意な文字列として与える&lt;br /&gt;
**上記2つを提供できない場合、システムはコンテナビューのIDを利用する&lt;br /&gt;
&lt;br /&gt;
====存在するViewGroupにフラグメントをプログラムから追加する====&lt;br /&gt;
*アクティビティが起動している間はいつでも、アクティビティレイアウトにフラグメントを追加することができる。&lt;br /&gt;
*単純にフラグメントを追加するViewGroupを指定するだけ。&lt;br /&gt;
*アクティビティの中のフラグメントトランザクション(フラグメントの追加、削除、置き換えなど)を作成するには、FragmentTransaction APIを利用する必要が有る。&lt;br /&gt;
*FragmentTransaction は、Actiityから、以下の様にインスタンスを取得できる。&lt;br /&gt;
 FragmentManager fragmentManager = getFragmentManager()&lt;br /&gt;
 FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();&lt;br /&gt;
*add()メソッドによって、フラグメントを追加することができる。&lt;br /&gt;
 ExampleFragment fragment = new ExampleFragment();&lt;br /&gt;
 fragmentTransaction.add(R.id.fragment_container, fragment);&lt;br /&gt;
 fragmentTransaction.commit();&lt;br /&gt;
*add()の最初の引数は、フラグメントを挿入すべきViewGroupのリソースID、2つめの引数は、追加するフラグメント&lt;br /&gt;
*FragmentTransaction に変更をかけたら、commit() を呼び出し、変更を確定する。&lt;br /&gt;
&lt;br /&gt;
====UIのないフラグメントの追加====&lt;br /&gt;
*UIを持たずにアクティビティのためにバックグラウンドで動作するフラグメントを利用することもできる。&lt;br /&gt;
*フラグメントをUIなしに追加するには、add(Fragment,String)(String には、一意となるフラグメントのタグかView ID を与える)を利用する&lt;br /&gt;
*これは、onCreateView() を受け取らないので、フラグメントを追加するが、アクティビティのレイアウトにビューを結びつけない。&lt;br /&gt;
*なので、onCreateView() メソッドは実装する必要がない。&lt;br /&gt;
&lt;br /&gt;
*UIフラグメントでないフラグメントにに与えるタグは、厳密ではない。&lt;br /&gt;
*UIを持たないフラグメントのタグは、その識別にのみ利用される。&lt;br /&gt;
*アクティビティから後でフラグメントを取得したい場合、findFragmentByTag() を利用する。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===フラグメントの管理===&lt;br /&gt;
*アクティビティのフラグメントを管理するには、FragmentManagerを getFragmentManager() から取得し、を利用する。&lt;br /&gt;
&lt;br /&gt;
=====FragmentManagerでできるいくつかのこと=====&lt;br /&gt;
*アクティビティに存在するフラグメントを findFragmentById()(アクティビティでUIを提供するフラグメント) または、findFragmentByTag()(UIを提供しないフラグメント) で取得する &lt;br /&gt;
*popBackStack() でフラグメントをバックスタックから取り出す。&lt;br /&gt;
*バックスタックの変更リスナーを addOnBackStackChangedListener() で登録する&lt;br /&gt;
&lt;br /&gt;
===フラグメントトランザクションの実行===&lt;br /&gt;
*アクティビティでフラグメントを利用する上で主要な機能は、追加、削除、置き換え、他のアクションを実行する能力。&lt;br /&gt;
*アクティビティへコミットする変更セットのそれぞれついて、トランザクションが呼び出され、FragmentTransaction APIを利用してトランザクションを実行できる。&lt;br /&gt;
*それぞれのトランザクションをアクティビティにより管理されるバックスタックへ保存することもできる。&lt;br /&gt;
*ユーザーは、フラグメントの変更を「戻る」ことができる。&lt;br /&gt;
&lt;br /&gt;
*適切な FragmentTransaction インスタンスをFragmentManagerから取得できる。&lt;br /&gt;
 FragmentManager fragmentManager = getFragmentManager();&lt;br /&gt;
 FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();&lt;br /&gt;
*それぞれのトランザクションは、同時に実行したい変更のセット&lt;br /&gt;
*add(),remove()やreplace()などトランザクションメソッドが呼ばれたときに実行させたいすべての変更をセットアップできる。&lt;br /&gt;
*アクティビティにトランザクションを適用するには、commit()する。&lt;br /&gt;
&lt;br /&gt;
*しかしながら、commit()する前に、トランザクションをフラグメントトランザクションのバックスタックに追加するために、addToBackStack()を実行したい場合もあるだろう。&lt;br /&gt;
*バックスタックは、アクティビティにより管理され、ユーザーに直前のフラグメントの状態に戻ることを可能にする。&lt;br /&gt;
&lt;br /&gt;
*以下は、どのようにフラグメントを置き換え、直前の状態をバックスタックに保持するかの例&lt;br /&gt;
 // あたらしいフラグメントとトランザクションの生成&lt;br /&gt;
 Fragment newFragment = new ExampleFragment();&lt;br /&gt;
 FragmentTransaction transaction = getFragmentManager().beginTransaction();&lt;br /&gt;
 &lt;br /&gt;
 // fragment_container ビューを fragment に置き換え、&lt;br /&gt;
 // トランザクションをバックスタックに積む&lt;br /&gt;
 transaction.replace(R.id.fragment_container, newFragment);&lt;br /&gt;
 transaction.addToBackStack(null);&lt;br /&gt;
 &lt;br /&gt;
 // トランザクションのコミット&lt;br /&gt;
 transaction.commit();&lt;br /&gt;
&lt;br /&gt;
*newFragment は、R.id.fragment_container IDを置き換え、addToBackStack()を呼び出すことで、この置き換えトランザクションをバックスタックに保存する。&lt;br /&gt;
*これにより、ユーザーがトランザクションをリバースし、直前のフラグメントにバックボタンで戻すことができる。&lt;br /&gt;
&lt;br /&gt;
*複数の変更をトランザクションに追加し、addToBackStack()を呼び出した場合、commit()を呼び出しすべての変更が適用される前のすべての変更がバックスタックに一つのトランザクションとして追加され、バックボタンでそれらすべてを元に戻すことができる。&lt;br /&gt;
&lt;br /&gt;
*変更をFragmentTransactionに追加するのに、以下を除いて、順序は関係ない&lt;br /&gt;
**commit()は最後に呼び出さなければならない&lt;br /&gt;
**同じコンテナに複数のフラグメントを追加した場合、それらを追加した順序は、ビューの階層に出現する順序となる。&lt;br /&gt;
&lt;br /&gt;
*もし、フラグメントを削除するトランザクションを実行したときに、addToBackStack() を呼ばなければ、フラグメントは、トランザクションのコミット時に破棄され、ユーザーは、戻ることができない。&lt;br /&gt;
*それに対して、addToBackStack()を呼び出した場合、フラグメントは停止され、ユーザーが戻る場合に、再開される。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;それぞれのフラグメントトランザクションに、setTransaction() を コミット前に呼ぶことによって、トランザクションアニメーションを適用できる。&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
*commit() を呼び出すことは、トランザクションを直ちに実行することではない。&lt;br /&gt;
*性格には、アクティビティのUIスレッドに直ちに実行するようにスケジュールする。&lt;br /&gt;
*しかしながら必要な場合、UIスレッドから直ちにトランザクションのcommit()を実行するように、executePendingTransaction() を呼ぶことができる。&lt;br /&gt;
*通常これは、トランザクションが、他のスレッドに依存していないかぎり、必要ではない。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;注意:commit()でトランザクションをコミットできるのは、アクティビティの保存時まで。この時点を過ぎてcommit()を試みると例外となる。なぜなら、コミット後の状態はアクティビティがリストアするときに失われてしまう&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
ため。&lt;/div&gt;</summary>
		<author><name>Piroto</name></author>
		
	</entry>
</feed>