[android] - harden MapboxMapOptions, extract duplicate fragment logic, fixup DoubleMapActivity (#7507)
This commit is contained in:
@@ -56,7 +56,7 @@ public class SupportMapFragmentActivity extends AppCompatActivity implements OnM
|
||||
.zoom(11)
|
||||
.build());
|
||||
|
||||
mapFragment = SupportMapFragment.newInstance(options);
|
||||
mapFragment = SupportMapFragment.newInstance();
|
||||
|
||||
transaction.add(R.id.fragment_container, mapFragment, "com.mapbox.map");
|
||||
transaction.commit();
|
||||
|
||||
@@ -47,13 +47,10 @@ public class DoubleMapActivity extends AppCompatActivity {
|
||||
actionBar.setDisplayShowHomeEnabled(true);
|
||||
}
|
||||
|
||||
Fragment mapFragment;
|
||||
if (savedInstanceState == null) {
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.add(R.id.fragment_container, mapFragment = new DoubleMapFragment(), TAG_FRAGMENT);
|
||||
transaction.add(R.id.fragment_container, new DoubleMapFragment(), TAG_FRAGMENT);
|
||||
transaction.commit();
|
||||
} else {
|
||||
mapFragment = (DoubleMapFragment) getSupportFragmentManager().findFragmentByTag(TAG_FRAGMENT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +147,13 @@ public class DoubleMapActivity extends AppCompatActivity {
|
||||
mapViewMini.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
mapView.onStart();
|
||||
mapViewMini.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
@@ -157,6 +161,13 @@ public class DoubleMapActivity extends AppCompatActivity {
|
||||
mapViewMini.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
mapView.onStop();
|
||||
mapViewMini.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
Reference in New Issue
Block a user