<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <!-- HEADER --> <include android:id="@+id/top_header" android:layout_alignParentTop="true" layout="@layout/window_title" /> <!-- FOOTER --> <LinearLayout android:id="@+id/bottom_menu" android:layout_width="fill_parent" android:layout_height="40dp" android:orientation="vertical" android:layout_alignParentBottom="true" android:background="#333333" android:gravity="center_horizontal"> <!-- menu bar --> <Button android:id="@+id/btn_edit_feature" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/btn_edit_feature" android:onClick="chooseFeatureLayer" /> <!-- <include layout="@layout/layout_footer_menu" /> --> </LinearLayout> <!-- MAIN PART --> <LinearLayout android:id="@+id/map_container" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/top_header" android:layout_above="@id/bottom_menu" android:layout_weight="1" android:padding="5dp" android:background="#550000"> </LinearLayout> </RelativeLayout>
mapView = new MapView(this); mapContainer = (LinearLayout) findViewById(R.id.map_container); mapContainer.addView(mapView); setContentView(R.layout.main);
<com.esri.android.map.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent"> </com.esri.android.map.MapView>
mapView = (MapView)findViewById(R.id.map);
I am also facing the similar issue. In my case, I am using Fragments which contain MapViews in their xml layouts of different screen dimension according to my app's design.
Only the MapView is working for the fragment which is loaded first. Other Fragment's MapViews (when initiated) are just showing the reflection of initiated MapView (of firstly loaded fragment). But 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.
Tried alot to come over this issue but still having it, can anybody please help me out?
It will be more than appreciated.
MapView's second xml layout is not working properly when adding its fragment