{"id":167315,"date":"2013-01-28T11:53:04","date_gmt":"2013-01-28T07:53:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=167315"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=167315","title":{"rendered":"<span class=\"post_title\">Android: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Fragments \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Fragments. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b Fragments. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Android 3.0 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432.<br \/>  \u0412\u043a\u0440\u0430\u0442\u0446\u0435, Fragment \u0441\u0445\u043e\u0436 \u0441 Activity, \u0443 \u043d\u0438\u0445 \u043e\u0431\u043e\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \u041e\u0434\u043d\u0430\u043a\u043e Fragment \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435 Activity. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 Activity \u0440\u0430\u0437\u043d\u044b\u0435 Fragments \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<a name=\"habracut\"><\/a><\/p>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e Fragments \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u0437\u0434\u0435\u0441\u044c:<br \/>  <a href=\"http:\/\/developer.android.com\/guide\/components\/fragments.html\">Fragments. Android Developer<\/a><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u0436\u0435 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043e\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b. \u041f\u0440\u0438 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u044d\u043a\u0440\u0430\u043d\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u0438 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443, \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f Activity, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043f\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435. \u041f\u0440\u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u044d\u043a\u0440\u0430\u043d\u0430, \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432\u043e Fragments \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u0421\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/developer.android.com\/images\/fundamentals\/fragments.png\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441 FragmentActivity, \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u043d\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"java\">public class FragmentActivity extends Activity { \t@Override \tpublic void onCreate(Bundle savedInstanceState) {     \tsuper.onCreate(savedInstanceState);     \tsetContentView(R.layout.fragment); \t} } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c layout \u0432 \u0444\u0430\u0439\u043b\u0435 fragment.xml \u0434\u043b\u044f \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u043a\u0440\u0430\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 FragmentActivity. \u0414\u043b\u044f \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0434\u0432\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430, \u043a\u0430\u0436\u0434\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u0448\u0438\u0440\u0438\u043d\u044b \u044d\u043a\u0440\u0430\u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \/res\/layout-land\/fragment.xml \u0434\u043b\u044f \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u043a\u0440\u0430\u043d\u0430:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot; \tandroid:layout_width=&quot;fill_parent&quot; \tandroid:layout_height=&quot;fill_parent&quot; \tandroid:orientation=&quot;horizontal&quot; &gt;  \t&lt;fragment class=&quot;com.example.hellopeacefullworld.FragmentList&quot;     \tandroid:id=&quot;@+id\/fragment_list&quot;     \tandroid:layout_weight=&quot;1&quot;     \tandroid:layout_width=&quot;match_parent&quot;     \tandroid:layout_height=&quot;match_parent&quot; &gt; \t&lt;\/fragment&gt;  \t&lt;fragment class=&quot;com.example.hellopeacefullworld.FragmentDetail&quot;     \tandroid:id=&quot;@+id\/fragment_detail&quot;     \tandroid:layout_weight=&quot;1&quot;     \tandroid:layout_width=&quot;match_parent&quot;     \tandroid:layout_height=&quot;match_parent&quot; &gt; \t&lt;\/fragment&gt;  &lt;\/LinearLayout&gt; <\/code><\/pre>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 \/res\/layout\/fragment.xml \u0434\u043b\u044f \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439(\u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043d\u043e\u0439) \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u044d\u043a\u0440\u0430\u043d\u0430:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot; \tandroid:layout_width=&quot;fill_parent&quot; \tandroid:layout_height=&quot;fill_parent&quot; \tandroid:orientation=&quot;horizontal&quot; &gt;  \t&lt;fragment class=&quot;com.example.hellopeacefullworld.FragmentList&quot;     \tandroid:id=&quot;@+id\/fragment_list&quot;     \tandroid:layout_width=&quot;match_parent&quot;     \tandroid:layout_height=&quot;match_parent&quot; &gt; \t&lt;\/fragment&gt; &lt;\/LinearLayout&gt; <\/code><\/pre>\n<p>  \u041e\u043f\u0438\u0448\u0435\u043c layout \u0444\u0430\u0439\u043b \/res\/layout\/fragment_detail_activity.xml \u0434\u043b\u044f Activity, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439(\u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043d\u043e\u0439) \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot; \tandroid:layout_width=&quot;match_parent&quot; \tandroid:layout_height=&quot;match_parent&quot; \tandroid:orientation=&quot;vertical&quot; &gt;  \t&lt;fragment class=&quot;com.example.hellopeacefullworld.FragmentDetail&quot;     \tandroid:id=&quot;@+id\/fragment_detail&quot;     \tandroid:layout_width=&quot;match_parent&quot;     \tandroid:layout_height=&quot;match_parent&quot; &gt; \t&lt;\/fragment&gt; &lt;\/LinearLayout&gt; <\/code><\/pre>\n<p>  \u0421\u0430\u043c \u043a\u043b\u0430\u0441\u0441 Activity. \u0412 \u043d\u0435\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0447\u0435\u0440\u0435\u0437 extras \u0441\u0441\u044b\u043b\u043a\u0443 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u0432 WebView \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u0414\u0430\u043d\u043d\u043e\u0435 Activity \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"java\">public class FragmentDetailActivity extends Activity { \t@Override \tpublic void onCreate(Bundle savedInstanceState) {     \tsuper.onCreate(savedInstanceState);     \tsetContentView(R.layout.fragment_detail_activity);     \tBundle extras = getIntent().getExtras();     String s = extras.getString(&quot;selectedValue&quot;);     WebView viewer = (WebView) findViewById(R.id.webView1);     viewer.loadUrl(s);  } } <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 FragmentList \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043c\u043d\u044b\u0439, \u043d\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 onListItemClick \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 FragmentDetail \u0441 WebView. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e goToLink(String link), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f FragmentDetailActivity, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 extras.<\/p>\n<pre><code class=\"java\">public class FragmentList extends ListFragment {      @Override      public void onActivityCreated(Bundle savedInstanceState) {       super.onActivityCreated(savedInstanceState);       String[] values = new String[] {    \t &quot;http:\/\/mobile.tutsplus.com\/tutorials\/mobile-design-tutorials\/80s-phone-app-slicing\/&quot;,    \t &quot;http:\/\/mobile.tutsplus.com\/tutorials\/corona\/create-a-brick-breaker-game-with-the-corona-sdk-game-controls\/&quot;,    \t &quot;http:\/\/mobile.tutsplus.com\/articles\/news\/best-of-tuts-in-february-2011\/&quot;};       ArrayAdapter adapter = new ArrayAdapter(getActivity(), android.R.layout.simple_list_item_1, values);       setListAdapter(adapter);      }       @Override      public void onListItemClick(ListView l, View v, int position, long id) {    \t String item = (String) getListAdapter().getItem(position);      \t FragmentDetail fragment = (FragmentDetail)getFragmentManager().findFragmentById(R.id.fragment_detail);      \t if (fragment != null && fragment.isInLayout()) {    \t\t fragment.goToLink(item);      \t } else {       \t\t Intent intent = new Intent(getActivity().getApplicationContext(), FragmentDetailActivity.class);       \t\t intent.putExtra(&quot;selectedValue&quot;, item);       \t\t startActivity(intent);           }      }     } <\/code><\/pre>\n<p>  \u041e\u043f\u0438\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441 FragmentDetail, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 WebView. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f goToLink(String link), \u043e\u043d\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 FragmentList.<\/p>\n<pre><code class=\"java\">public class FragmentDetail extends Fragment {      @Override      public View onCreateView(LayoutInflater inflater, ViewGroup container,    \tBundle savedInstanceState) {    \t  View view = inflater.inflate(R.layout.fragment_detail, container, false);    \t  return view;      }           public void goToLink(String item){    \t  WebView viewer = (WebView)getView().findViewById(R.id.webView1);    \t  viewer.loadUrl(item);      } } <\/code><\/pre>\n<p>  \u0424\u0430\u0439\u043b fragment_detail.xml<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;LinearLayout xmlns:android=&quot;http:\/\/schemas.android.com\/apk\/res\/android&quot; \tandroid:layout_width=&quot;match_parent&quot; \tandroid:layout_height=&quot;match_parent&quot; \tandroid:orientation=&quot;vertical&quot; &gt;  \t&lt;WebView     \tandroid:id=&quot;@+id\/webView1&quot;     \tandroid:layout_width=&quot;match_parent&quot;     \tandroid:layout_height=&quot;match_parent&quot; \/&gt;      &lt;\/LinearLayout&gt; <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u0430 FragmentDetailActivity. \u0414\u0430\u043d\u043d\u043e\u0435 Activity \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0432 \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u0414\u0430\u043d\u043d\u043e\u0435 Activity \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0432 WebView \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0435\u0431-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<pre><code class=\"java\">public class FragmentDetailActivity extends Activity { \t@Override \tpublic void onCreate(Bundle savedInstanceState) {    \t\t super.onCreate(savedInstanceState);      \t setContentView(R.layout.fragment_detail_activity);      \t Bundle extras = getIntent().getExtras();      \t String s = extras.getString(&quot;selectedValue&quot;);      \t WebView viewer = (WebView) findViewById(R.id.webView1);      \t viewer.loadUrl(s);  } } <\/code><\/pre>\n<p>  \u041d\u0443 \u0432\u043e\u0442 \u0438 \u0432\u0441\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/leprastuff.ru\/data\/img\/20130128\/thumb_82797952d1e05243100c83d32cc25e08.png\"\/><img decoding=\"async\" src=\"http:\/\/leprastuff.ru\/data\/img\/20130128\/thumb_18fdf29af360e07196357857e9bc7642.png\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/leprastuff.ru\/data\/img\/20130127\/thumb_8b5e654b18710f18de32217c45a0aed4.png\"\/><\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/167315\/\"> http:\/\/habrahabr.ru\/post\/167315\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Fragments. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b \u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u044b Fragments. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 Android 3.0 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432.<br \/>  \u0412\u043a\u0440\u0430\u0442\u0446\u0435, Fragment \u0441\u0445\u043e\u0436 \u0441 Activity, \u0443 \u043d\u0438\u0445 \u043e\u0431\u043e\u0438\u0445 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \u041e\u0434\u043d\u0430\u043a\u043e Fragment \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435 Activity. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 Activity \u0440\u0430\u0437\u043d\u044b\u0435 Fragments \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0430\u0435\u0442 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0438 \u0432\u0430\u0440\u0438\u0430\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-167315","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/167315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=167315"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/167315\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}