Reputation: 1
i want to manage the page state like stack in the Maui Blazor hybrid mobile application. and also need to handle the navigation keys in the android system.
i already tried this with navigation manager but state is not managing. and also not able to handle the android navigation keys like (back button)
Upvotes: 0
Views: 368
Reputation: 4332
Well, as an answer, you can try the solution of this case: Maui сhange navigation in BlazorWebView.
and also not able to handle the android navigation keys like (back button) .
Use the following code, I can hit it when I use back button:
public class MainActivity : MauiAppCompatActivity
{
public override bool DispatchKeyEvent(KeyEvent? e)
{
if ((e.KeyCode == Keycode.Back) && (e.Action == KeyEventActions.Down))
{
Console.WriteLine(e.KeyCode);
}
return base.DispatchKeyEvent(e);
}
}
Upvotes: 0