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

Regular Contributor
Posts: 63
Registered: ‎08-30-2012
My Device: 9900
My Carrier: Various

Blackberry List with Image from Rss Feed

I developed an Rss Feed reader for Blackberry java,and i successfully displayed titles from Rss URL.but my requirement is displaying images and titles from Rss URL.In my drawListRow method i am able to retrieve the titles and image URL's from Rss,but i am not getting what is the code i need to write in the method to display image and title on screen?


Here my code:

public class RssScreen extends MainScreen implements ListFieldCallback,FieldChangeListener {
Connection _connectionthread;
private static ListField _list;
String image;
String title;
private static Vector listElements = new Vector();
private static Vector listImage = new Vector();

public long mycolor ;
VerticalFieldManager mainManager;
VerticalFieldManager subManager;
int selectedList;
Radio radio;

public RssScreen(){
final Bitmap backgroundBitmap = Bitmap.getBitmapResource("blackbackground.png");

mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR )

public void paint(Graphics graphics)
graphics.drawBitmap(0, 0, Display.getWidth(),Display.getHeight(),backgroundBitmap, 0, 0);



subManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR )
protected void sublayout( int maxWidth, int maxHeight )
int displayWidth = Display.getWidth();
int displayHeight = Display.getHeight();

super.sublayout( displayWidth, displayHeight);
setExtent( displayWidth, displayHeight);


_list = new ListField()

protected boolean navigationClick(int status, int time)
return true;
public void paint(Graphics graphics)

graphics.setColor((int) mycolor);


mycolor = 0x00FFFFFF;
_list.setEmptyString("* Feeds Not Available *", DrawStyle.HCENTER);
_connectionthread = new Connection();


public void drawListRow(ListField list, Graphics g, int index, int y, int w)

int yPos = 0+y;
g.drawLine(0, yPos, w, yPos);
g.drawText(radio.getTitle(), 5, 15+y, 0, w);

public Object get(ListField list, int index)
return listElements.elementAt(index);
public int indexOfList(ListField list, String prefix, int string)
return listElements.indexOf(prefix, string);
public int getPreferredWidth(ListField list)
return Display.getWidth();
public void insert(String toInsert, int index) {

public void fieldChanged(Field field, int context) {






Posts: 17,012
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Blackberry List with Image from Rss Feed

everything your listfield should display is done in drawListRow.
currently you draw a line and a text, you can also draw a bitmap there.
i would suggest to set the rowheight to a value your images fit (outside of drawlistrow!) and use g.drawBitmap to paint the list row.
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter