If you change the View multiple times sometimes a new View is getting created in the Viewfactory. (I'm using Afterburner btw, but that shouldn't be the Issue) This happens on every device (Desktop and Mobile)
The following code is in the init method
addViewFactory(viewname, () -> {
return new ExampleView();
})
The above example produces multiple instances of the same view (which breaks some presenters of mine)
A quick fix can be seen below, but shouldn't be necessary.
ExampleView view = null;
addViewFactory(viewname, () -> {
if (view == null) {
view = (View) new ExampleView.getView();
}else{
//comment out the line below to see that this is really happening
//throw new RuntimeException("Created View multiple times");
}
return view;
});
EDIT:
The View-Changing happens still with switchView(String)