2012-04-23 82 views
1

下面的代碼打開了應用程序,瀏覽器加載並顯示指定的url。現在我想要的是瀏覽器加載並在應用程序打開後在後臺運行。瀏覽器必須加載並在後臺運行

public class start extends MainScreen { 

    public start() { 
     super(); // Call to super 
     String url = ("http://www.google.com/"); 
     //A BrowserSession is created 
     BrowserSession BS = Browser.getDefaultSession(); 
     BS.displayPage(url); 
    } 

    public boolean onClose() { 
     System.exit(0); 
     return true; // Close the system 
    } 
} 

回答

0

撥打電話UiApplication.getUiApplication().requestForeground()打開瀏覽器中的URL後,我不會建議在UI內部調用System.exit()。實際上,UI應用程序將在上次屏幕關閉後立即關閉。

相關問題