SIA
SIA

Reputation: 771

Cannot display images in BitmapField in Blackberry application using simulator 9700?

I am getting Error while displaying bitmap file in my application. code:

Bitmap logoBitmap = Bitmap.getBitmapResource("res/icon.png");
BitmapField bitmapField1 = new BitmapField(logoBitmap, Field.FIELD_HCENTER);
add(bitmapField1);

Getting error in console tab. Error: Fridg:couldnot find res/icon.png.

I am using Eclipse with Blackberry Simulator 9700. I have added the folder and images and it is displaying in the tree of Eclipse.

Upvotes: 2

Views: 952

Answers (1)

vlaku
vlaku

Reputation: 1575

The solution is to remove "res/" from source string, because it uses res as a source folder.

Upvotes: 4

Related Questions