0

I'm using sliding menu for Android here is the link, when I slide on rendered map fragment, the sliding menu goes blank.

Here is my map fragment code.

public class BasicMapActivity extends SherlockFragment {
    private MapView mMapView;
    private GoogleMap mMap;

    @Override
    public View onCreateView(LayoutInflater inflater, 
                             ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.basic_demo, null);
        // view.setBackgroundColor(0x00000000);
        mMapView = (MapView) view.findViewById(R.id.map);
        container.requestTransparentRegion(mMapView);
        mMapView.onCreate(savedInstanceState);
        return view;
    }
}

Here is my home activity where in i render map.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_home_frame);
    getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.home_screen, new BasicMapActivity())
            .commit();


    getSlidingMenu().setSecondaryMenu(
            getLayoutInflater().inflate(R.layout.resq_events_frame, null));
    getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.resq_events_screen, new EventsFragment())
            .commit();

    // set the Behind View
    setBehindContentView(R.layout.activity_settings_frame);

    getSupportFragmentManager()
            .beginTransaction()
            .replace(R.id.settings_screen, new SettingsFragment())
            .commit();

    // customize the SlidingMenu
    getSlidingMenu().setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
}

My XML file looks like this

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/home_screen"
    android:layout_width="match_parent"
    android:layout_height="match_parent">        
</FrameLayout>

How to overcome by this issue?

Here how the image looks.

enter image description here

JJD
  • 50,076
  • 60
  • 203
  • 339
Naruto
  • 9,476
  • 37
  • 118
  • 201
  • Can we get a screenshot showing before after? – Warpzit Feb 24 '13 at 06:32
  • Hi, i have uploaded image, if i take screenshot its giving me correct image, so i need to take snap from another camera.. kindly help – Naruto Feb 24 '13 at 08:09
  • @Warpzit, i have added snapshot as you per your request – Naruto Feb 25 '13 at 04:05
  • Can you give SS from what it should look like as well. Also the link to the known issue you think is related. – Warpzit Feb 25 '13 at 09:13
  • @Warpzit, i got frustrated, thought of changing layout. do you have any idea how to do this kind of layouot http://stackoverflow.com/questions/15116271/how-to-implement-custom-drop-down-menu-to-actionbar-in-android – Naruto Feb 27 '13 at 15:50
  • Or you could use this solution which I already answered here... [http://stackoverflow.com/a/24186016/1560536][1] [1]: http://stackoverflow.com/a/24186016/1560536 – Govinnage Rasika Perera Jun 12 '14 at 13:49

1 Answers1

1

The issue is due to GoogleMap, you have to add this map:zOrderOnTop="true" to your XML map layout, like

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" >

    <fragment
        android:name="com.google.android.gms.maps.SupportMapFragment"
        xmlns:map="http://schemas.android.com/apk/res-auto"         
        android:id="@+id/map" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent"
        map:zOrderOnTop="true" />

</LinearLayout>
general03
  • 855
  • 1
  • 10
  • 33