<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to maintain fragment in a activity? in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-maintain-fragment-in-a-activity/m-p/328776#M2169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My design is there are 4 fragments in a activity with a page-controler align the bottom.two of them with map.&lt;/P&gt;&lt;P&gt;The question is:&lt;/P&gt;&lt;P&gt;1、use hide show fragment function:if i click the button of&amp;nbsp;page-controler which with map,the&amp;nbsp;previous map could be see in the new fragment and the map in new fragment can't be see,but it should be loaded because the data is print in logcat.so the new fragment can't handle my touch listener;&lt;/P&gt;&lt;P&gt;2、use replace fragment function it works,but it will reload without cache each click...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Mar 2017 08:33:55 GMT</pubDate>
    <dc:creator>tanparcool</dc:creator>
    <dc:date>2017-03-16T08:33:55Z</dc:date>
    <item>
      <title>how to maintain fragment in a activity?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-maintain-fragment-in-a-activity/m-p/328776#M2169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My design is there are 4 fragments in a activity with a page-controler align the bottom.two of them with map.&lt;/P&gt;&lt;P&gt;The question is:&lt;/P&gt;&lt;P&gt;1、use hide show fragment function:if i click the button of&amp;nbsp;page-controler which with map,the&amp;nbsp;previous map could be see in the new fragment and the map in new fragment can't be see,but it should be loaded because the data is print in logcat.so the new fragment can't handle my touch listener;&lt;/P&gt;&lt;P&gt;2、use replace fragment function it works,but it will reload without cache each click...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 08:33:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-maintain-fragment-in-a-activity/m-p/328776#M2169</guid>
      <dc:creator>tanparcool</dc:creator>
      <dc:date>2017-03-16T08:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to maintain fragment in a activity?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-maintain-fragment-in-a-activity/m-p/328777#M2170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are having trouble with the Fragment Lifecycle (&lt;A class="link-titled" href="https://developer.android.com/guide/components/fragments.html#Lifecycle" title="https://developer.android.com/guide/components/fragments.html#Lifecycle"&gt;Fragments | Android Developers&lt;/A&gt;). &amp;nbsp;One thing to consider is that while the fragment is not visible, it can still be in the&amp;nbsp;&lt;EM&gt;onCreate()&lt;/EM&gt; stage of the lifecycle as this relies more on the containing activity to manage it. &amp;nbsp;Having said that, my suggestions for your questions are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Have you tried setting the map view in each fragment to pause when the fragment enters its&amp;nbsp;&lt;EM&gt;onPause()&lt;/EM&gt; callback&lt;/P&gt;&lt;P&gt;(&lt;A class="link-titled" href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#pause()" title="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#pause()"&gt;MapView.pause()&lt;/A&gt;&amp;nbsp;) and when the fragment enters its&amp;nbsp;&lt;EM&gt;onResume()&lt;/EM&gt; callback, call the resume method of the mapView (&lt;A class="link-titled" href="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#resume()" title="https://developers.arcgis.com/android/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#resume()"&gt;MapView.resume()&lt;/A&gt;&amp;nbsp;) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Following the aforementioned step may relieve the symptoms you are feeling in issue 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 12:33:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-maintain-fragment-in-a-activity/m-p/328777#M2170</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-03-22T12:33:35Z</dc:date>
    </item>
  </channel>
</rss>

