Hi All,
I want to implement Mobile Back Button Functionality in my Xamarin Android Application.
Basically I had done following code in all the pages:-
public override bool OnKeyDown(Keycode keyCode, KeyEvent e)
{
if (e.KeyCode == Keycode.Back) {
base.OnBackPressed ();
}
return base.OnKeyDown(keyCode, e);
}
Now the issue which i am facing is, i had opened multiple pages in following sequence :-
Home Page -> Listing -> Detail -> Listing -> Detail etc.
Now on pressing back button , it traverse back to all of the pages in following order :-
Detail -> Listing -> Again Detail(should not to come) -> Listing(should not to come) -> Home -> Exit
What i need is Detail -> Listing -> Home -> Exit only.
I had tried with Finish() too but it doesn't work.
Can anyone help me out?
Thanks in Advance.