View Single Post
Old 06-07-2010, 03:58 AM   #7
Ashis
Knows Where the Search Button Is
 
Join Date: Jun 2010
Model: NA
PIN: N/A
Carrier: NA
Posts: 15
Default

hi Baskar,

may i know why r u pushing 'indexScreen' after showBrowser();
and i think bSession.showBrowser(); is also not required...

try the following sample code

Code:
public class BrowserDemo extends UiApplication
{
    public static void main(String[] args)
    {
        BrowserDemo d = new BrowserDemo();
        d.enterEventDispatcher();
    }

    public BrowserDemo()
    {
        pushScreen(new BrowserScreen());
    }

}

class BrowserScreen extends MainScreen
{
    public BrowserScreen()
    {
        LabelField title = new LabelField("demonstrating browser");
        setTitle(title);

        BrowserSession visit = Browser.getDefaultSession();
        visit.displayPage("http www google com");
        visit.showBrowser();
    }
}
Offline   Reply With Quote