carsten-klaffke / send-intent

Repository for send-intent Capacitor plugin
MIT License
106 stars 12 forks source link

App crashes upon changing device orientation #88

Closed arrayman closed 7 months ago

arrayman commented 7 months ago

Hello. As title say, upon changing the device orientation, my app crashes This behavior is also observed in the sample application.

im on android 13.

I currently do not have a solution, but it would be fantastic if we could address this issue in some way.

Thank you for your work and attention!

arrayman commented 7 months ago

Adding this android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"

to 'your activity' apparently makes the app stop closing upon changing the device orientation,

so i will close the usues in a few days.

thank again for your work.

pd: this give me a light "https://stackoverflow.com/questions/19435981/multiple-intent-processing-due-orientation-change"

carsten-klaffke commented 7 months ago

With the configChanges setting, you can apparently define the actions that lead to an activity restart (or don't). In my class SendIntentActivity, the app gets closed on stop or pause, which seems to be triggered when the activity restarts. So, yes, using that setting is probably the best way to handle the orientation-change problem (which I btw. have in my own app as well...). Thank you for figuring that out!