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
Contributor
Posts: 28
Registered: ‎01-31-2012
My Device: 8520
My Carrier: Telkomsel

BrowserField error launch

please help,

I create browse field for displaying facebook page when application launched it wont let land on facebook,page appear after clicked back button.

Any suggest how to displayed facebook page on first launched? below attached the script

package com.samples.toolkit.ui.test;

import net.rim.device.api.browser.field2.BrowserField;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;

public class UIExampleFacebookRPM extends UIExampleScreen
{
	 
		private MainScreen _screen;
		private BrowserField _bf2;
			
		UIExampleFacebookRPM()  
		{		
			_bf2 = new BrowserField();

			_screen = new MainScreen();
		        _screen.add(_bf2);
			pushScreen(_screen);

			_bf2.requestContent("http://m.facebook.com/myfb");
		}
		
		private void pushScreen(MainScreen _screen) {
			// TODO Auto-generated method stub
			UiApplication.getUiApplication().pushScreen(_screen);
		}

		public static void main(String[] args) 
		{
			UIExampleFacebookRPM app = new UIExampleFacebookRPM();        
			app.enterEventDispatcher();        
		}

		private void enterEventDispatcher() {
			// TODO Auto-generated method stub
			UiApplication.getUiApplication().enterEventDispatcher();
		}
	} 

 Need Help

 

Best Regards

 

Galih

Contributor
Posts: 28
Registered: ‎01-31-2012
My Device: 8520
My Carrier: Telkomsel

Re: BrowserField error launch

Need Help Plisss
Developer
Posts: 30
Registered: ‎02-02-2012
My Device: 9780
My Carrier: DU. UAE

Re: BrowserField error launch

You create the mainSCreen with a button to connect to FB , and on clicking that button call 

 

Browser.getDefaultSession().displayPage(
					"http://m.facebook.com/myfb");
			

 When you move back from the FB page your mainscreen will be displayed.

Contributor
Posts: 49
Registered: ‎12-29-2011
My Device: 9800
My Carrier: vodafone

Re: BrowserField error launch

BrowserSession browSession = Browser.getDefaultSession(); browSession.displayPage(Url); browSession.showBrowser();