File tree Expand file tree Collapse file tree
java-app/src/main/java/com/example/maps3djava/routes
kotlin-app/src/main/java/com/example/maps3dkotlin/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ protected void onCreate(Bundle savedInstanceState) {
126126 super .onCreate (savedInstanceState );
127127 setContentView (R .layout .activity_routes );
128128
129+ // Re-bind map3DView to the new active instance in activity_routes.xml and forward lifecycle
130+ map3DView = findViewById (R .id .map3dView );
131+ map3DView .onCreate (savedInstanceState );
132+ map3DView .getMap3DViewAsync (this );
133+
129134 // Configure custom toolbar
130135 MaterialToolbar toolbar = findViewById (R .id .top_bar );
131136 toolbar .setTitle (getString (R .string .feature_title_routes_api ));
Original file line number Diff line number Diff line change @@ -113,6 +113,11 @@ class RoutesActivity : SampleBaseActivity() {
113113 super .onCreate(savedInstanceState)
114114 setContentView(R .layout.activity_routes)
115115
116+ // Re-bind map3DView to the new active instance in activity_routes.xml and forward lifecycle
117+ map3DView = findViewById(R .id.map3dView)
118+ map3DView.onCreate(savedInstanceState)
119+ map3DView.getMap3DViewAsync(this )
120+
116121 // Override toolbar back action
117122 findViewById< com.google.android.material.appbar.MaterialToolbar > (R .id.top_bar).apply {
118123 title = getString(R .string.feature_title_routes_api)
You can’t perform that action at this time.
0 commit comments