Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Map fragment is black after resume

I have application that have on her main screen map (v2) with buttons. These buttons after click run another application and this (main activity) is in stack. After in that another activity is called finish(),main activity is back in front. But after this, map fragment is black and it's not working.

enter image description here

This is my fragment XML:

<fragment
    android:id="@+id/mapFragment"
    android:layout_width="100px"
    android:layout_height="100px"
    class="com.google.android.gms.maps.MapFragment" />

And the only thing I'm doing is setContentView(R.layout.new_main); and nothing more.

This problem is almost like mine: Android MapView v2 Black screen, and also with no answer.

like image 531
Tunerx Avatar asked Aug 20 '13 08:08

Tunerx


2 Answers

Please try with the code which is given below:

@Override
public void onResume() {
    super.onResume();
    mapFragment.onResume();
}
like image 80
Mohini Thakkar Avatar answered Nov 15 '22 05:11

Mohini Thakkar


I Disable hardware acceleration at file manifest.xml, and my application doesnt show black map again in second load. i try it in emulator.

<application android:hardwareAccelerated="false">
 ...
</application

from this article: http://developer.android.com/guide/topics/graphics/hardware-accel.html

like image 43
seri Avatar answered Nov 15 '22 03:11

seri