61
6: Code sample
BrowserContent browserContent = null;
try {
browserContent = _renderingSession.getBrowserContent(connection, this, e);
if (browserContent != null) {
Field field = browserContent.getDisplayableContent();
if (field != null) {
synchronized (Application.getEventLock()) {
_mainScreen.deleteAll();
_mainScreen.add(field);
}
}
browserContent.finishLoading();
}
} catch (RenderingException re) {
} finally {
SecondaryResourceFetchThread.doneAddingImages();
}
}
/**
* @see
net.rim.device.api.browser.RenderingApplication#eventOccurred(net.rim.device.api.browser.E
vent)
*/
public Object eventOccurred(Event event) {
int eventId = event.getUID();
switch (eventId) {
case Event.EVENT_URL_REQUESTED : {
UrlRequestedEvent urlRequestedEvent = (UrlRequestedEvent) event;
String absoluteUrl = urlRequestedEvent.getURL();
HttpConnection conn = null;
PrimaryResourceFetchThread thread = new
PrimaryResourceFetchThread(urlRequestedEvent.getURL(),
urlRequestedEvent.getHeaders(),
urlRequestedEvent.getPostData(),
event,
this);
thread.start();
break;
} case Event.EVENT_BROWSER_CONTENT_CHANGED: {
// browser field title might have changed update title
BrowserContentChangedEvent browserContentChangedEvent =
(BrowserContentChangedEvent) event;
if (browserContentChangedEvent.getSource() instanceof BrowserContent) {
BrowserContent browserField = (BrowserContent)
browserContentChangedEvent.getSource();
String newTitle = browserField.getTitle();
if (newTitle != null) {
_mainScreen.setTitle(newTitle);
}
}
break;
} case Event.EVENT_REDIRECT : {
Содержание JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE
Страница 1: ...BlackBerry Java Development Environment Version 4 6 0 BlackBerry Device Applications Integration Guide...
Страница 4: ......
Страница 7: ......
Страница 10: ...10 BlackBerry Device Applications Integration Guide...
Страница 12: ...12 BlackBerry Device Applications Integration Guide...
Страница 50: ...50 BlackBerry Device Applications Integration Guide...
Страница 56: ...56 BlackBerry Device Applications Integration Guide...
Страница 65: ......
Страница 66: ...2008 Research In Motion Limited Published in Canada...