38
Views
1
Comments
[Barcode Scanner Plugin] Avoid exiting the app when clicking on Android's back button
Question
barcode-scanner-plugin
Mobile icon
Forge asset by www.justsolve.co.za

When I'm using an Android and I click the Android's back button, the application is closed. Is there any way to redirect it to the previous app screen instead of closing the app?


Thanks.

UserImage.jpg
Dylan Heunis

Hi António,

The quickest fix that I could find was to do a check if the barcode result is empty, and then do a transition to the current screen.  This is obviously not an optimal solution, because everything in the DOM is reset which would be undesirable in most cases.  My suspicion is that something in the cordova plugin could be causing the issue.

I will however be checking if I can find anything else.

Kind regards,

Dylan

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.