Comments (2)
This exception is trhowed when your Activity is not configured to handle the configuration change, in that case the android runtime recreates the activity. To avoid the issue it is sufficient to adjust ConfigurationChanges of the ActivityAttribute. In your case it should be similar to:
namespace ControlCatalog.Android
{
[Activity(Label = "ControlCatalog.Android"
, Theme = "@style/MyTheme.NoActionBar"
, Icon = "@drawable/icon", MainLauncher = true
, Exported = true
, ConfigurationChanges = ConfigChanges.Orientation
| ConfigChanges.ScreenSize
| ConfigChanges.UiMode
| ConfigChanges.SmallestScreenSize
| ConfigChanges.ScreenLayout
| ConfigChanges.Keyboard
| ConfigChanges.KeyboardHidden
| ConfigChanges.Navigation
)]
// CategoryBrowsable and DataScheme are required for Protocol activation.
// CategoryLeanbackLauncher is required for Android TV.
[IntentFilter(new [] { ActionView }, Categories = new [] { CategoryDefault, CategoryBrowsable, CategoryLeanbackLauncher }, DataScheme = "avln" )]
public class MainActivity : AvaloniaMainActivity<App>
{
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
{
return base.CustomizeAppBuilder(builder)
.AfterSetup(_ =>
{
Pages.EmbedSample.Implementation = new EmbedSampleAndroid();
});
}
}
}
from avalonia.
That fixed it! Thank you so much @workgroupengineering!
from avalonia.
Related Issues (20)
- 11.1.0 - Window position is incorrect when the SystemDecorations property is set to BorderOnly
- Add settings to customize the label of buttons of native file dialogs on linux or make them localizable HOT 1
- TextBlock render wrong text in some situations. HOT 8
- ActivatableLifetime for Android is not working HOT 1
- StyleInclude CherylUI Index.axaml throws exception HOT 2
- ReactiveUI's `WhenActivated` does not work with `WinFormsAvaloniaControlHost` HOT 1
- Huge memory leaks in my app
- 11.1.0 - Two-way binding doesn't update source property if target property has not been changed
- XYFocus cannot easily be restricted to branches of the visual tree. HOT 3
- Avalonia.Browser cannot run correctly HOT 1
- ActivatableLifetime for Android is not working HOT 1
- ArrangeCore handling of Stretch and Margins is inconsistent with WPF
- Cannot set Margin/Padding/Alignment for DataGridTextColumn.Header HOT 2
- Starting browser project fails out of the box HOT 1
- Avalonia 11.1.1 Fullscreen doesn't work anymore (Android Tablet)
- Asset type conversions does not work for things that extent Image or Bitmap HOT 1
- ColorView - broken style in Simple theme HOT 2
- Double type StyledProperty not long support binding to an int value in 11.1.0 HOT 1
- Caption Buttons disappearing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avalonia.