Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open webview in Blackberry?

How to open link in webview in Blackberry like iPhone and Android ?

Which should not be open in Browser ,it should be opening in Webview through application .

like image 281
dev Avatar asked Apr 14 '11 10:04

dev


1 Answers

The Blackberry equivalent of a WebView is a BrowserField. Example code from this page:

import net.rim.device.api.browser.field2.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;

public class BrowserFieldDemo extends UiApplication
{
    public static void main(String[] args)
    {
        BrowserFieldDemo app = new BrowserFieldDemo();
        app.enterEventDispatcher();
    }

    public BrowserFieldDemo()
    {
        pushScreen(new BrowserFieldDemoScreen());
    }
}

class BrowserFieldDemoScreen extends MainScreen
{
    public BrowserFieldDemoScreen()
    {
        BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
        myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
        BrowserField browserField = new BrowserField(myBrowserFieldConfig);

        add(browserField);
        browserField.requestContent("http://www.blackberry.com");
    }
}
like image 88
Core.B Avatar answered Nov 08 '22 16:11

Core.B