android-signaturepad icon indicating copy to clipboard operation
android-signaturepad copied to clipboard

The SignaturePad becomes null on rotation in fragment

Open mptrista opened this issue 8 years ago • 3 comments
trafficstars

We have an activity with ViewPager with fragments. In one of the fragments we have a SignaturePad. The signature pad become null after rotation. Despite that the user signature stays on screen.

mptrista avatar Nov 10 '17 14:11 mptrista

Hello,

when you rotate the screen, the fragment is destroyed and needs to be recreated. We have code to store the internal state of the signature pad in the memory. Could you please be more specific on "the signature pad become null"?

gcacace avatar Feb 24 '18 14:02 gcacace

Hello,

For sure the save and restore instance is not working correctly. Svg data are lost. After restoring the method getSignatureSvg() does returns an empty SVG.

What about to save and restore the svg data and redraw on the canvas (bitmap) from the svg data?

ghost avatar Sep 16 '18 09:09 ghost

same here!

there is a PR (https://github.com/gcacace/android-signaturepad/pull/117) trying to fix that, however it needs to be checked

Regards.

eriknyk avatar Oct 18 '18 16:10 eriknyk