Problem handle virtual back button on Android

My problem is: when I click on login button after login success it navigate to home screen, after that I click on virtual back button on Androdi device it back but previous screen, it mean back to login page.

I need to handle virtual back button on Anroid. I need to check if current is home screen if they click on back button I will close application.

Can anyone help me?. I need some advice thanks.

Hi Hien,

Let me see if I understood. You want to exit the app every time a user clicks on back while in the home screen, is that what you want?

I would also like to know how to work with Androids Back Button.

any solution for this?