/** Shows current tweet dialog and downloads user image */ private void showTweet() { String text = current_tweet.getText(); if (text != null) { String from = current_tweet.getFromUser(); Alert a = new Alert("" + from, text, null, AlertType.INFO); a.setTimeout(Alert.FOREVER); display.setCurrent(a, this); String url = current_tweet.getProfileImageUrl(); if (url != null) { // download and set user image to visible alert Image img; InputStream is = null; try { is = Connector.openInputStream(url); img = Image.createImage(is); a.setImage(img); } catch (Throwable t) { // do not show errors if image // download fails } finally { try { if (is != null) { is.close(); } } catch (Throwable e) { } } } } }