Esri / Esri/arcgis-runtime-toolkit-android
Compass crashes application on rotation from portrait to landscape.
- Dominant language
- Kotlin
- Stars
- 59
- Forks
- 40
- PR merge metrics
- No merged PRs in 30d
Description
I have the compass initialized after I setup my mapView. when I rotate the device from portrait to landscape I get the error below.
I'm using 100.6.0 SDK
mMapView.setMap(new ArcGISMap(map));
mCompass = new Compass(mMapView.getContext());
mCompass.setAutoHide(false);
mCompass.addToGeoView(mMapView);
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.thevillages.myfirstapp, PID: 28447
com.esri.arcgisruntime.ArcGISRuntimeException: Invalid argument: Null value.
at com.esri.arcgisruntime.internal.jni.CoreMapView.nativeGetRotation(Native Method)
at com.esri.arcgisruntime.internal.jni.CoreMapView.s(SourceFile:224)
at com.esri.arcgisruntime.internal.h.b.o.p(SourceFile:236)
at com.esri.arcgisruntime.mapping.view.MapView.getMapRotation(SourceFile:317)
at com.esri.arcgisruntime.toolkit.compass.Compass$viewpointChangedListener$1.viewpointChanged(Compass.kt:136)
at com.esri.arcgisruntime.internal.h.b.af$1.run(SourceFile:51)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Contributor guide
Research direction
Start at Compass.kt line 136, where the viewpoint-changed listener calls MapView.getMapRotation. Reproduce the reported setup with SDK 100.6.0 and rotate the device from portrait to landscape. Done means the application no longer crashes during that rotation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100