gcacace / android-signaturepad

A custom Android View for drawing smooth signatures
Apache License 2.0
2.76k stars 640 forks source link

On App minimize its crashing #169

Open ravi1805 opened 2 years ago

ravi1805 commented 2 years ago

When you are in signature activity and app goes in background then it's crashing, any solution for this.

java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 4207940 bytes at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:161) at android.os.Handler.handleCallback(Handler.java:883) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:8167) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) Caused by: android.os.TransactionTooLargeException: data parcel size 4207940 bytes at android.os.BinderProxy.transactNative(Native Method) at android.os.BinderProxy.transact(BinderProxy.java:575) at android.app.IActivityTaskManager$Stub$Proxy.activityStopped(IActivityTaskManager.java:5148) at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:145) at android.os.Handler.handleCallback(Handler.java:883)  at android.os.Handler.dispatchMessage(Handler.java:100)  at android.os.Looper.loop(Looper.java:237)  at android.app.ActivityThread.main(ActivityThread.java:8167)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) 

mahashisho commented 2 years ago

Inside your activity , put this code @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.clear(); }

albedinsky commented 2 years ago

We are now also experiencing this issue after upgrading from version 1.2.1 to version 1.3.1.

connyhald commented 2 years ago

Duplicate of #153

waheed006 commented 2 years ago

Inside your activity , put this code @OverRide protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.clear(); }

This worked for me as well

gustavocnp95 commented 2 years ago

We just created a fork and published with the fix keeping the state saving. For use it you should:

Set jitpack.io url on your project's build.gradle

allprojects {
    repositories {
        google()
        maven { url "https://jitpack.io" }
   }
}

and then, add into your depedencies this:

implementation 'com.github.prologapp:android-signaturepad:1.0.0'

mcoville commented 1 year ago

I used the suggestion from this comment and the app stopped crashing. https://github.com/gcacace/android-signaturepad/issues/153#issuecomment-838216460