[Android back button] Android back button issue

[Android back button] Android back button issue

  
Forge Component
(4)
Published on 2017-09-05 by Miguel Vicente
4 votes
Published on 2017-09-05 by Miguel Vicente

Hi,

I am using the forge component called "Android Back Button" , in order to customize the native android back button. Using that plugin i had customized the flow of back button navigation in every screens, but now I am facing the issue in login screen.

1.When I was in the login page and i am entering a incorrect Login credentials, the login page shows me some error messages.

2.Now I am, deleting those credentials and I am entering another wrong credentials again.

3.At the third time, i am clearing all those credentials and now i am entering new correct credentials, the application enters into the homescreen and after that i will do logout, so that i will be navigated back to the login screen.

4.At this scenario, I hitting the native android back button,

              *I will be renavigated to the login screen with decond entered login credential.

              *For second click on native android back, i will be again renavigated to the login screen with very first login credentials

              *Now at the third time, by hitting the native android back button, one empty login page will be displayed and after that only my application getting closed.

I want to avoid this scenario, and i just need to close the application if the android back is clicked on the login screen. Can anyone help in this one, better if i get any Javascript code. So, I can place it in the android back button event of login screen.

Thanks,

Vignesh Balasubramanian.

Solution

Hi Vignesh,

If you would like to force the user to exit the app you could use a javascript node on the event back in login and run this code: "navigator.app.exitApp();". 

Please let me know if it solved your situation.

Thank you,

Kind Regards,

Miguel Vicente

Solution

Hi Miguel,

Thanks for your support and guidance to solve the problem. Placed the suggested Javascript code in the "OnBackKeyDownEvent" event handler.

Thanks,

Vignesh Balasubramanian.

Hi Vignesh,

You are always welcome.

To be honest with your situation I will lunch a new version of the component with an option already if you want to exist the app. 

Thank you for the feedback! 

Kind Regards,

Miguel Vicente 

Hi Miguel,

Thanks for your support and response, thanks for the new update.

Regards,

Vignesh Balasubramanian