This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
ActivatableLifetime for Android is not working #16457
Labels
You can continue the conversation there. Go to discussion →
Describe the bug
public override void OnCreate(Bundle? savedInstanceState, PersistableBundle? persistentState)
{
// Global IActivatableLifetime expects a main activity, so we need to replace it on each OnCreate.
if (Avalonia.Application.Current?.TryGetFeature()
is AndroidActivatableLifetime activatableLifetime)
{
activatableLifetime.Activity = this;
}
base.OnCreate(savedInstanceState, persistentState);
}
So this thing is never being called. Probably you should override OnCreate(Bundle? savedInstanceState) method. Idk maybe I'm targeting wrong api but as see Avalonia is not using OnCreate(Bundle? savedInstanceState, PersistableBundle? persistentState) method at all and all of the Init things is done inside OnCreate(Bundle? savedInstanceState) method
To Reproduce
ActivatableLifetime returns with Activity = null on Android device
Expected behavior
ActivatableLifetime should work on Android
Avalonia version
11.1.0
OS
Android
Additional context
No response
The text was updated successfully, but these errors were encountered: