Comments (1)
Hi @SergeHelfrichPI, sorry for the late reply and thank you for your detailed question. With the steps listed, this is expected, in such a case you need to recreate the map view. Basically, this is what the error message is indicating.
@Override
protected void onPause() {
mapView.onPause();
super.onPause();
}
@Override
protected void onResume() {
mapView.onResume();
super.onResume();
}
@Override
protected void onDestroy() {
mapView.onDestroy();
disposeHERESDK();
super.onDestroy();
}
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
mapView.onSaveInstanceState(outState);
super.onSaveInstanceState(outState);
}
When you call mapView.onSaveInstanceState(outState)
then all map items that are added to the map, like markers, polylines and so on, will be kept based on the bundled state - even if the screen orientation changes. However, if instead you want to create a new map view instance for each orientation change, then make sure to reinitialize the HERE SDK and call mapView.onCreate(null)
- a new HERE SDK instance or likewise a new MapView
instance cannot be used together with a bundled state that was created based on previous instances.
If this answer is not sufficient, please leave a reply. Thank you!
UDPDATE: Here is a little bit more background info. In the example app, the HERE SDK is destroyed since there is only a single activity. In a more complex app it is also possible, to keep the HERE SDK alive and only destroy it when the app itself is terminated. Then, when an orientation change occurs, it does not need to be recreated. For example, an application can check if the saved bundle is not null, and thus do not recreate the SDK. This way, the stored map view instance can be reused. On the other hand - when the SDK should be also reinitialized, then also the map view instance needs to be recreated and thus, calling mapView.onCreate(null)
is needed. The map view instance can only be reused by the same SDK instance. If the SDK instance changes, then also the map view instance needs to be recreated.
from here-sdk-examples.
Related Issues (20)
- Generate Here MAP route image with source and destination location marker HOT 1
- Navigation on Android Auto HOT 1
- Here Map Marker Click Isssue #504 HOT 4
- Missing vehicle restrictions function (Explore Edition) HOT 3
- Getting HERE Places with null coordinates HOT 1
- Crash due to library not being able to load on OnePlus Nord 3 5G HOT 1
- [ERROR] sdk-AppContextProvider - SDK NativeEngine doesn't exist during initialisation! HOT 1
- Crash in ConsentActivity.onCreate HOT 2
- Unable to find option to download Navigate Edition SDK HOT 1
- Here Map(Navigate framework) version - 4.15.4.0 - App not getting build - following error Undefined symbol: _$sSSs5Error7heresdkMc HOT 1
- Maploader.dart file not found in v 4.17.3 for offline use HOT 1
- Android's CameraKeyframeTracks example is not working at API 28 (Android 9.0) HOT 1
- [android auto] Pan not work HOT 1
- Swift.String : Swift.Error HOT 3
- [Android - Navigate SDK] Map Marker Drag HOT 3
- Different line layout HOT 1
- Custom Map marker Layering HOT 1
- Change marker HOT 1
- [Android - Explore Edition] The map blink and throwing error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from here-sdk-examples.