java.lang.IllegalStateException: Underflow in restore - more restores than saves
Below is the full error log
FATAL EXCEPTION: main Process: com.jwetherell.augmented_reality, PID: 1989 java.lang.IllegalStateException: Underflow in restore - more restores than saves at android.graphics.Canvas.native_restore(Native Method) at android.graphics.Canvas.restore(Canvas.java:522) at com.jwetherell.augmented_reality.ui.Radar.draw(Radar.java:105) at com.jwetherell.augmented_reality.activity.AugmentedView.onDraw(AugmentedView.java:78) at android.view.View.draw(View.java:17201) at android.view.View.updateDisplayListIfDirty(View.java:16183) at android.view.View.draw(View.java:16967) at android.view.ViewGroup.drawChild(ViewGroup.java:3731) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3517) at android.view.View.updateDisplayListIfDirty(View.java:16178) at android.view.View.draw(View.java:16967) at android.view.ViewGroup.drawChild(ViewGroup.java:3731) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3517) at android.view.View.updateDisplayListIfDirty(View.java:16178) at android.view.View.draw(View.java:16967) at android.view.ViewGroup.drawChild(ViewGroup.java:3731) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3517) at android.view.View.draw(View.java:17204) at com.android.internal.policy.DecorView.draw(DecorView.java:753) at android.view.View.updateDisplayListIfDirty(View.java:16183) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:648) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:654) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:762) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2818) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2626) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2233) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1272) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6408) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874) at android.view.Choreographer.doCallbacks(Choreographer.java:686) at android.view.Choreographer.doFrame(Choreographer.java:621) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6165) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
It crashes in Android 6.0 and above devices. with
Below is the full error log
FATAL EXCEPTION: main Process: com.jwetherell.augmented_reality, PID: 1989 java.lang.IllegalStateException: Underflow in restore - more restores than saves at android.graphics.Canvas.native_restore(Native Method) at android.graphics.Canvas.restore(Canvas.java:522) at com.jwetherell.augmented_reality.ui.Radar.draw(Radar.java:105) at com.jwetherell.augmented_reality.activity.AugmentedView.onDraw(AugmentedView.java:78) at android.view.View.draw(View.java:17201) at android.view.View.updateDisplayListIfDirty(View.java:16183) at android.view.View.draw(View.java:16967) at android.view.ViewGroup.drawChild(ViewGroup.java:3731) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3517) at android.view.View.updateDisplayListIfDirty(View.java:16178) at android.view.View.draw(View.java:16967) at android.view.ViewGroup.drawChild(ViewGroup.java:3731) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3517) at android.view.View.updateDisplayListIfDirty(View.java:16178) at android.view.View.draw(View.java:16967) at android.view.ViewGroup.drawChild(ViewGroup.java:3731) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3517) at android.view.View.draw(View.java:17204) at com.android.internal.policy.DecorView.draw(DecorView.java:753) at android.view.View.updateDisplayListIfDirty(View.java:16183) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:648) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:654) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:762) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2818) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2626) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2233) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1272) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6408) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874) at android.view.Choreographer.doCallbacks(Choreographer.java:686) at android.view.Choreographer.doFrame(Choreographer.java:621) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6165) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)