cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between the two ways to switch screens?

Tnguy.3
Associate III

I have the following two codes that does the same thing,

application().switchScreen(new Screen3View());
static_cast<FrontendApplication*>(Application::getInstance())->gotoBrightnessScreenNoTransition();

But, the second one took more work since I need to set it up in the FrontendApplication.cpp, but I was wondering is there a difference between these two calls (beside one allows you to edit the transition)?

2 REPLIES 2
Romain DIELEMAN
ST Employee

Hi,

There is none. The idea behind the first one is that it can be called a bit anywhere as long as you have the id of the screen you want to go to. The second one will mostly be used for if you want a screen transition animation which does not seem to be the case for you.

/Romain

Tnguy.3
Associate III

Hi Romain, thanks for your response. Please correct me if I'm wrong, but from one of my testing, when I use the first statement to switch to a screen that interacts with the model and presenter, I get a null exception error in my presenter trying to talk to the model BUT don't get it when I use the second statement to switch. So is it safe to say that using the first call does not pass the same model (assuming all views uses the same model) to new screen?

Or, was I just missing something?