BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-01-2010, 09:42 AM   #1 (permalink)
New Member
 
SergioTapia's Avatar
 
Join Date: Aug 2010
Model: 7100T
PIN: N/A
Carrier: asdfasdf
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot add a picture to my application UI.

Please Login to Remove!

Here is a screenshot of the solution explorer:
cant because of post count? wtf?


And here is the code I'm using. Note that the RichTextFields do show up, but no picture. I've tried displaying both of the pictures in the res folder but no dice.


Code:
final class HelloWorldScreen extends MainScreen {
	BitmapField logoField;

	public HelloWorldScreen() {
		super();
		LabelField title = new LabelField("Moxxy Email Sender",
				LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
		setTitle(title);
		
		add(new RichTextField("1. Where do you want to send this?"));
		add(new RichTextField("2. What's your name?"));
		add(new RichTextField("3. Write down your message:"));
		Bitmap logoImage = Bitmap.getBitmapResource("res/tip.png");
		logoField = new BitmapField(logoImage, Field.FIELD_HCENTER);
		add(logoField);
	}

	public boolean onClose() {
		Dialog.alert("Goodbye!");
		System.exit(0);
		return true;
	}

}
Offline  
Old 09-01-2010, 10:49 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Make sure you are checking "logoImage" for null - this is what you will get if getBitmapResource() cannot locate the resource.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.