<?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 MapView's second xml layout is not working properly when adding its fragment in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-s-second-xml-layout-is-not-working/m-p/56776#M433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I am using Fragments which contain MapViews in their xml layouts of different screen dimension according to my app's design.&lt;BR /&gt;Only the MapView is working for the fragment which is loaded first. Other Fragment's MapViews (when initiated) are just showing the blocked reflection of initiated MapView (of firstly loaded fragment) but its basemap layer is working in the area of actionbar. And when I get my app's resume state back after having its pause the MapView of the other fragment (top fragment of back stack) is working fine as it should be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Tried alot to come over this issue but still having it, can you/anybody please help me out?&lt;BR /&gt;It will be more than appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;FirstFragment.xml&lt;/H1&gt;&lt;P&gt;&amp;lt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;com.esri.android.map.MapView&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:id=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"@+id/map"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_width=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"fill_parent"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_height=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"fill_parent"&lt;/SPAN&gt;/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;STRONG&gt;FirstFragment.java&lt;/STRONG&gt;&lt;/H1&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public &lt;/SPAN&gt;View onCreateView(LayoutInflater inflater, ViewGroup container,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Bundle savedInstanceState) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mInflater &lt;/SPAN&gt;= inflater;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(savedInstanceState != &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= savedInstanceState.getString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Create new MapView object. Note that, unlike Layers objects, the MapView can't be retained when the Activity is&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; // destroyed and recreated, because the old MapView is tied to the old Activity.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mView &lt;/SPAN&gt;= inflater.inflate(R.layout.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;fragment_map&lt;/SPAN&gt;, container, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; initViews(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mView&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Create layers unless retained objects are available&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;== &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISDynamicMapServiceLayer(AppConstants.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;server_url_service_mapserver&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.addLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Restore map state (center and resolution) if a previously saved state is available, otherwise set initial extent&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.restoreState(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.setOnStatusChangedListener(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;OnStatusChangedListener() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onStatusChanged(Object o, STATUS status) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; AppUtils.&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapState &lt;/SPAN&gt;= &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.retainState();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;return &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mView&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onSaveInstanceState(Bundle outState) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onSaveInstanceState(outState);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Save the map state (map center and resolution).&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; outState.putString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;initViews(View view) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;= (MapView) view.findViewById(R.id.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;map&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onResume() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onResume();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Start the MapView running again&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.unpause();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onPause() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onPause();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.retainState();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.pause();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onDestroyView() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onDestroyView();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Must remove our layers from MapView before calling recycle(), or we won't be able to reuse them&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null &lt;/SPAN&gt;&amp;amp;&amp;amp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.removeLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Release MapView resources&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.recycle();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="text-align: left;"&gt;&lt;STRONG&gt;FragmentTwo.xml&lt;/STRONG&gt;&lt;/H1&gt;&lt;P&gt;&amp;lt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;com.esri.android.map.MapView&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:id=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"@+id/map_poi_details"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_width=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"match_parent"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_height=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"100dp"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_marginTop=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"10dp"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_below=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"@+id/tv_poi_details_phone"&lt;/SPAN&gt;/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;/H1&gt;&lt;H1&gt;FragmentTwo.java&lt;/H1&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public &lt;/SPAN&gt;View onCreateView(LayoutInflater inflater, ViewGroup container,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Bundle savedInstanceState) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Reinstate saved instance state (if any)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(savedInstanceState != &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= savedInstanceState.getString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Create new MapView object. Note that, unlike Layers objects, the MapView can't be retained when the Activity is&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; // destroyed and recreated, because the old MapView is tied to the old Activity.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;view &lt;/SPAN&gt;= inflater.inflate(R.layout.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;fragment_poi_details&lt;/SPAN&gt;, container, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView &lt;/SPAN&gt;= (MapView) &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;view&lt;/SPAN&gt;.findViewById(R.id.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;map_poi_details&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Restore map state (center and resolution) if a previously saved state is available, otherwise set initial extent&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.restoreState(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;//else&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; //mMapView.restoreState(AppUtils.mMapState);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; // Create layers unless retained objects are available&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;== &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISDynamicMapServiceLayer(AppConstants.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;server_url_service_mapserver&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.addLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;return &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;view&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onDestroyView() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onDestroyView();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Must remove our layers from MapView before calling recycle(), or we won't be able to reuse them&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.removeLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Release MapView resources&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.recycle();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onSaveInstanceState(Bundle outState) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onSaveInstanceState(outState);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Save the map state (map center and resolution).&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; outState.putString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onResume() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onResume();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.unpause();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onPause() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onPause();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.retainState();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.pause();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 24pt;"&gt;FirstFragment &lt;SPAN style="font-size: 14pt;"&gt;(First screen which is working fine)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="127295" alt="Screenshot_2015-09-18-11-05-56.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/127295_Screenshot_2015-09-18-11-05-56.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 24pt;"&gt;FragmentTwo&lt;/SPAN&gt; &lt;SPAN style="font-size: 14pt;"&gt;(On scroll it is showing blocked reflection of FirstFragment's MapView )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot_2015-09-18-11-06-51.png" class="image-5 jive-image" src="https://community.esri.com/legacyfs/online/127353_Screenshot_2015-09-18-11-06-51.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 24pt;"&gt;FragmentTwo&lt;/SPAN&gt; &lt;SPAN style="font-size: 14pt;"&gt;(In action bar area it is giving its basemap layer with scrolling motion when we scroll FragmentTwo Up and down and also this layer is working fine as FragmentTwo's mapview should be)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;IMG __jive_id="127297" alt="Screenshot_2015-09-18-11-07-10.png" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/127297_Screenshot_2015-09-18-11-07-10.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN style="font-size: 24pt;"&gt;FragmentTwo&lt;/SPAN&gt; &lt;SPAN style="font-size: 14pt;"&gt;(After pausing application and resume again to FragmentTwo the mapview is working &lt;SPAN style="font-size: 18.6667px;"&gt;fine as it should be)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot_2015-09-18-11-07-44.png" class="image-6 jive-image" src="https://community.esri.com/legacyfs/online/127354_Screenshot_2015-09-18-11-07-44.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Here's Logcat details when loading FragmentTwo:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;09-18 11:25:30.479&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap W/SurfaceView﹕ CHECK surface infomation creating=false formatChanged=false sizeChanged=false visible=false visibleChanged=true surfaceChanged=true realSizeChanged=false redrawNeeded=false left=false top=false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --------- beginning of /dev/log/system&lt;/P&gt;&lt;P&gt;09-18 11:25:32.999&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap W/ApplicationContext﹕ Unable to create external cache directory&lt;/P&gt;&lt;P&gt;09-18 11:25:33.069&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap D/AbsListView﹕ Get MotionRecognitionManager&lt;/P&gt;&lt;P&gt;09-18 11:25:33.349&amp;nbsp;&amp;nbsp; 1310-16948/myapp.arcgismap E/copybit﹕ Error opening frame buffer errno=13 (Permission denied)&lt;/P&gt;&lt;P&gt;09-18 11:25:33.349&amp;nbsp;&amp;nbsp; 1310-16948/myapp.arcgismap W/Adreno200-EGLSUB﹕ &amp;lt;updater_create_surface_state:342&amp;gt;: updater_create_surface_state failed to open copybit, error: -13&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1312/myapp.arcgismap D/dalvikvm﹕ GC_CONCURRENT freed 5137K, 39% free 18443K/30151K, paused 12ms+30ms, total 131ms&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 73ms&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap D/AbsListView﹕ [unregisterDoubleTapMotionListener]&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap I/MotionRecognitionManager﹕ .unregisterListener : / listener count = 0-&amp;gt;0,&lt;/P&gt;&lt;P&gt;09-18 11:25:33.579&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap D/AbsListView﹕ [unregisterDoubleTapMotionListener]&lt;/P&gt;&lt;P&gt;09-18 11:25:33.579&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap I/MotionRecognitionManager﹕ .unregisterListener : / listener count = 0-&amp;gt;0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/23124"&gt;Shelly Gill&lt;/A&gt;​ &lt;A href="https://community.esri.com/migrated-users/2013"&gt;Joshua Giese&lt;/A&gt;​&lt;A href="https://community.esri.com/migrated-users/2014"&gt;Ramchand Rao&lt;/A&gt;​&lt;A href="https://community.esri.com/migrated-users/2015"&gt;Scott Dabbs&lt;/A&gt;​&lt;A href="https://community.esri.com/migrated-users/2017"&gt;Steve Vu&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Sep 2015 06:31:57 GMT</pubDate>
    <dc:creator>HassanJamil</dc:creator>
    <dc:date>2015-09-18T06:31:57Z</dc:date>
    <item>
      <title>MapView's second xml layout is not working properly when adding its fragment</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-s-second-xml-layout-is-not-working/m-p/56776#M433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I am using Fragments which contain MapViews in their xml layouts of different screen dimension according to my app's design.&lt;BR /&gt;Only the MapView is working for the fragment which is loaded first. Other Fragment's MapViews (when initiated) are just showing the blocked reflection of initiated MapView (of firstly loaded fragment) but its basemap layer is working in the area of actionbar. And when I get my app's resume state back after having its pause the MapView of the other fragment (top fragment of back stack) is working fine as it should be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Tried alot to come over this issue but still having it, can you/anybody please help me out?&lt;BR /&gt;It will be more than appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;FirstFragment.xml&lt;/H1&gt;&lt;P&gt;&amp;lt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;com.esri.android.map.MapView&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:id=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"@+id/map"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_width=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"fill_parent"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_height=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"fill_parent"&lt;/SPAN&gt;/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;STRONG&gt;FirstFragment.java&lt;/STRONG&gt;&lt;/H1&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public &lt;/SPAN&gt;View onCreateView(LayoutInflater inflater, ViewGroup container,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Bundle savedInstanceState) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mInflater &lt;/SPAN&gt;= inflater;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(savedInstanceState != &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= savedInstanceState.getString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Create new MapView object. Note that, unlike Layers objects, the MapView can't be retained when the Activity is&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; // destroyed and recreated, because the old MapView is tied to the old Activity.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mView &lt;/SPAN&gt;= inflater.inflate(R.layout.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;fragment_map&lt;/SPAN&gt;, container, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; initViews(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mView&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Create layers unless retained objects are available&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;== &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISDynamicMapServiceLayer(AppConstants.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;server_url_service_mapserver&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.addLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Restore map state (center and resolution) if a previously saved state is available, otherwise set initial extent&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.restoreState(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.setOnStatusChangedListener(&lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;OnStatusChangedListener() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onStatusChanged(Object o, STATUS status) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; AppUtils.&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapState &lt;/SPAN&gt;= &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.retainState();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;return &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mView&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onSaveInstanceState(Bundle outState) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onSaveInstanceState(outState);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Save the map state (map center and resolution).&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; outState.putString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private void &lt;/SPAN&gt;initViews(View view) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;= (MapView) view.findViewById(R.id.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;map&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onResume() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onResume();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Start the MapView running again&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.unpause();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onPause() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onPause();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.retainState();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.pause();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onDestroyView() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onDestroyView();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Must remove our layers from MapView before calling recycle(), or we won't be able to reuse them&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null &lt;/SPAN&gt;&amp;amp;&amp;amp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.removeLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Release MapView resources&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView&lt;/SPAN&gt;.recycle();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;mMapView &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 style="text-align: left;"&gt;&lt;STRONG&gt;FragmentTwo.xml&lt;/STRONG&gt;&lt;/H1&gt;&lt;P&gt;&amp;lt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;com.esri.android.map.MapView&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:id=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"@+id/map_poi_details"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_width=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"match_parent"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_height=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"100dp"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_marginTop=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"10dp"&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;android&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-weight: bold;"&gt;:layout_below=&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"@+id/tv_poi_details_phone"&lt;/SPAN&gt;/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;/H1&gt;&lt;H1&gt;FragmentTwo.java&lt;/H1&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public &lt;/SPAN&gt;View onCreateView(LayoutInflater inflater, ViewGroup container,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Bundle savedInstanceState) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Reinstate saved instance state (if any)&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(savedInstanceState != &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= savedInstanceState.getString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Create new MapView object. Note that, unlike Layers objects, the MapView can't be retained when the Activity is&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; // destroyed and recreated, because the old MapView is tied to the old Activity.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;view &lt;/SPAN&gt;= inflater.inflate(R.layout.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;fragment_poi_details&lt;/SPAN&gt;, container, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;false&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView &lt;/SPAN&gt;= (MapView) &lt;SPAN style="color: #660e7a; font-style: italic;"&gt;view&lt;/SPAN&gt;.findViewById(R.id.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;map_poi_details&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Restore map state (center and resolution) if a previously saved state is available, otherwise set initial extent&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.restoreState(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;//else&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; //mMapView.restoreState(AppUtils.mMapState);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp; // Create layers unless retained objects are available&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if&lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;== &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISDynamicMapServiceLayer(AppConstants.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;server_url_service_mapserver&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.addLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;return &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-style: italic;"&gt;view&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onDestroyView() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onDestroyView();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Must remove our layers from MapView before calling recycle(), or we won't be able to reuse them&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.removeLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBaseMapDynamicLayer&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Release MapView resources&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.recycle();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onSaveInstanceState(Bundle outState) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onSaveInstanceState(outState);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;// Save the map state (map center and resolution).&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;!= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; outState.putString(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;KEY_MAP_STATE&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onResume() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onResume();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.unpause();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onPause() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;super&lt;/SPAN&gt;.onPause();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapState &lt;/SPAN&gt;= &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.retainState();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mMapView&lt;/SPAN&gt;.pause();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 24pt;"&gt;FirstFragment &lt;SPAN style="font-size: 14pt;"&gt;(First screen which is working fine)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="127295" alt="Screenshot_2015-09-18-11-05-56.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/127295_Screenshot_2015-09-18-11-05-56.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 24pt;"&gt;FragmentTwo&lt;/SPAN&gt; &lt;SPAN style="font-size: 14pt;"&gt;(On scroll it is showing blocked reflection of FirstFragment's MapView )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot_2015-09-18-11-06-51.png" class="image-5 jive-image" src="https://community.esri.com/legacyfs/online/127353_Screenshot_2015-09-18-11-06-51.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 24pt;"&gt;FragmentTwo&lt;/SPAN&gt; &lt;SPAN style="font-size: 14pt;"&gt;(In action bar area it is giving its basemap layer with scrolling motion when we scroll FragmentTwo Up and down and also this layer is working fine as FragmentTwo's mapview should be)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;IMG __jive_id="127297" alt="Screenshot_2015-09-18-11-07-10.png" class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/127297_Screenshot_2015-09-18-11-07-10.png" style="height: auto;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN style="font-size: 24pt;"&gt;FragmentTwo&lt;/SPAN&gt; &lt;SPAN style="font-size: 14pt;"&gt;(After pausing application and resume again to FragmentTwo the mapview is working &lt;SPAN style="font-size: 18.6667px;"&gt;fine as it should be)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screenshot_2015-09-18-11-07-44.png" class="image-6 jive-image" src="https://community.esri.com/legacyfs/online/127354_Screenshot_2015-09-18-11-07-44.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;Here's Logcat details when loading FragmentTwo:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;09-18 11:25:30.479&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap W/SurfaceView﹕ CHECK surface infomation creating=false formatChanged=false sizeChanged=false visible=false visibleChanged=true surfaceChanged=true realSizeChanged=false redrawNeeded=false left=false top=false&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --------- beginning of /dev/log/system&lt;/P&gt;&lt;P&gt;09-18 11:25:32.999&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap W/ApplicationContext﹕ Unable to create external cache directory&lt;/P&gt;&lt;P&gt;09-18 11:25:33.069&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap D/AbsListView﹕ Get MotionRecognitionManager&lt;/P&gt;&lt;P&gt;09-18 11:25:33.349&amp;nbsp;&amp;nbsp; 1310-16948/myapp.arcgismap E/copybit﹕ Error opening frame buffer errno=13 (Permission denied)&lt;/P&gt;&lt;P&gt;09-18 11:25:33.349&amp;nbsp;&amp;nbsp; 1310-16948/myapp.arcgismap W/Adreno200-EGLSUB﹕ &amp;lt;updater_create_surface_state:342&amp;gt;: updater_create_surface_state failed to open copybit, error: -13&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1312/myapp.arcgismap D/dalvikvm﹕ GC_CONCURRENT freed 5137K, 39% free 18443K/30151K, paused 12ms+30ms, total 131ms&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1310/myapp.arcgismap D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 73ms&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap D/AbsListView﹕ [unregisterDoubleTapMotionListener]&lt;/P&gt;&lt;P&gt;09-18 11:25:33.549&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap I/MotionRecognitionManager﹕ .unregisterListener : / listener count = 0-&amp;gt;0,&lt;/P&gt;&lt;P&gt;09-18 11:25:33.579&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap D/AbsListView﹕ [unregisterDoubleTapMotionListener]&lt;/P&gt;&lt;P&gt;09-18 11:25:33.579&amp;nbsp;&amp;nbsp;&amp;nbsp; 1310-1319/myapp.arcgismap I/MotionRecognitionManager﹕ .unregisterListener : / listener count = 0-&amp;gt;0,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/23124"&gt;Shelly Gill&lt;/A&gt;​ &lt;A href="https://community.esri.com/migrated-users/2013"&gt;Joshua Giese&lt;/A&gt;​&lt;A href="https://community.esri.com/migrated-users/2014"&gt;Ramchand Rao&lt;/A&gt;​&lt;A href="https://community.esri.com/migrated-users/2015"&gt;Scott Dabbs&lt;/A&gt;​&lt;A href="https://community.esri.com/migrated-users/2017"&gt;Steve Vu&lt;/A&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Sep 2015 06:31:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/mapview-s-second-xml-layout-is-not-working/m-p/56776#M433</guid>
      <dc:creator>HassanJamil</dc:creator>
      <dc:date>2015-09-18T06:31:57Z</dc:date>
    </item>
  </channel>
</rss>

