Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 9
Registered: ‎12-15-2011
My Device: 9900
My Carrier: Vodafone

9810 OS 7 BrowserFieldConfig Orientation Issue

[ Edited ]


Hi All,

 

in my project, i have used the BrowserFieldConfig to display the  local html file. below codeing working fine in all devices with orientation except 9810 OS 7. 

 

Problem with 9810 OS 7 device is:

When i open the html page in the landsape mode.. it is displaying properly without any issue.. after if i change the orientation to portrait html text is cutting. means it is still taking the landscape mode width instead of Portrait mode width. Text is not adjusting to the screen automatically.

 

 

 

 

BrowserContent browserContent = null;
        try {
            BrowserFieldConfig config = new BrowserFieldConfig();
            config.setProperty(BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_NONE);
            config.setProperty(BrowserFieldConfig.ENABLE_COOKIES, Boolean.TRUE);
            config.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
            config.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
            config.setProperty(BrowserFieldConfig.USER_SCALABLE, Boolean.FALSE);
            
            BrowserField field = new BrowserField(config);
            ProtocolController httpController = new ProtocolController(field);
            httpController.setNavigationRequestHandler("http", new BrowserFieldNavigationRequestHandler() {
                public void handleNavigation(BrowserFieldRequest request) {
                    BrowserSession browser = Browser.getDefaultSession();
                    browser.displayPage(request.getURL());
                }
            });

            ProtocolController httpsController = new ProtocolController(field);
            httpsController.setNavigationRequestHandler("https", new BrowserFieldNavigationRequestHandler() {
                public void handleNavigation(BrowserFieldRequest request) {
                    BrowserSession browser = Browser.getDefaultSession();
                    browser.displayPage(request.getURL());
                }
            });

            field.getConfig().setProperty(BrowserFieldConfig.CONTROLLER, httpController);
            field.getConfig().setProperty(BrowserFieldConfig.CONTROLLER, httpsController);
            field.displayContent(connection, (_url == null) ? "" : _url);
            _browserListener.browserFieldRetrieved(field);
        } catch (Exception re) {
            
        } finally {

 


 



Output after changing to portrait mode