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
BlackBerry Development Advisor
Posts: 15,694
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: BrowserField's displayContent not working on device.

I tried the following code on a BlackBerry Bold 9780 running 6.0 bundle 872 (6.0.0.289) and it worked fine.  What application/bundle version are you using?  Can you upgrade that device?

 

MainScreen mainScreen = new MainScreen();
		
		BrowserFieldConfig config = new BrowserFieldConfig();
		HttpHeaders headers = new HttpHeaders();
		headers.addProperty(HttpHeaders.HEADER_CONTENT_TYPE, HttpHeaders.CONTENT_TYPE_TEXT_HTML);
		headers.addProperty(HttpHeaders.HEADER_ACCEPT_CHARSET, "UTF-8");
		config.setProperty(BrowserFieldConfig.HTTP_HEADERS, headers);
		BrowserField contentField = new BrowserField(config);

		mainScreen.add(contentField);
		contentField.displayContent(htmlText,"");
		
		pushScreen(mainScreen);

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Contributor
Posts: 44
Registered: ‎01-12-2011
My Device: Not Specified

Re: BrowserField's displayContent not working on device.

Hi

 

I just noticed that It works sometimes. The code is exactly the same. I haven't changed anything. The text is shown perfectly well. But sometimes when I restart the device, It stops working. Nothing displays on the screen. I put the whole code in the try catch block. No exception is occurring, the text is right too.. But it does not show anything. What could be the possible reason ?

 

Please suggest.

 

Thanks.

BlackBerry Development Advisor
Posts: 15,694
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: BrowserField's displayContent not working on device.

Can you post a snippet from the event log taken after this fails that shows the application being launched (and some lines after)?  You can extract an event log using the following command.

 

javaloader -u eventlog > mylog.txt

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker