cancel
Showing results for 
Search instead for 
Did you mean: 

How to get current screen

shark
Senior

My application has many screens, after idle for some time, I need to show a advertisement screen.

I want to implement it something like Modal dialog box to cover the whole current screen. So I need to get the current active screen, actually a container is enough as modal window's parent.

Are there an api to get current screen? I dont want to trace every screen by myself as there are many and more and more later.

2 REPLIES 2
shark
Senior

Screen*sp = Application::getInstance()->getCurrentScreen();

sp->getRootContainer().add(myModalWindow);

myModalWindow.show();

It can show the myModalWindow on top of current window, But touch interactive not work. Maybe rootContainer is special, but how to solve it?

shark
Senior

button inside modal windows works ok. but setTouchable(true) can not trigger event handleClickEvent()