03-15-2011 11:00 AM
Hi,
Can someone tell me if it's possible to close a mainscreen in its navigationClick method please ?
In my app, when the user click on a screen, I need to close the screen (actually the app) and visit a website for example.
Do I write : close();
Browser.visit...
or do I write :
Browser.visit...
close();
thanks, Laurent
03-15-2011 11:08 AM
to close a screen, you can use:
UiApplication.getUiApplication().popScreen(yourScr
and next you can invoke the browser.
Ps: sorry for my english.
03-15-2011 12:27 PM
you will need to execute following code:
UiApplication.getUiApplication().popScreen(this);
Browser.getDefaultSession().displayPage(String pageUrl);
in navigationClick() method of main screen.
03-15-2011 01:03 PM
Thank you.
It seems to me I should use :
UiApplication.getUiApplication().popScreen(this);
instead of :
close();
I'll try this code.
Thanks again.
Laurent
03-15-2011 03:19 PM - edited 03-15-2011 03:19 PM
The simpliest way to do this is to overide the screens own close method such as
MainScreen _screen = new MainScreen()
{
public void close()
{
Browser.getDefaultSession().displayPage("http://ebscer.com");
super.close();
}
};
03-16-2011 02:09 AM
I'm facing the same issue with
UiApplication.getUiApplication().popScreen(this);
or close();
The application is send to background and blocked. I can't open it again !
My main screen is a popupScreen, not a mainscreen.
Should I overwrite the close method in my own class ?