Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Map api 2 how to show/hide GoogleMap?

i want to show/hide googleMap.

GoogleMap  googleMap = ((SupportMapFragment) getSupportFragmentManager()
                    .findFragmentById(R.id.map2)).getMap();

how to set setVisibility(View.INVISIBLE) OR setVisibility(View.VISIBLE) ??

like image 285
Samir Mangroliya Avatar asked Apr 19 '26 23:04

Samir Mangroliya


1 Answers

you should hide the Fragment itself, or you can try with getView().setVisibility(View.INVISIBLE) inside the SupportMapFragment subclass.

From your Activity:

FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction()
ft.hide(mFragment).commit();
like image 111
Blackbelt Avatar answered Apr 22 '26 14:04

Blackbelt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!