BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 10-02-2008, 02:33 PM   #1 (permalink)
New Member
 
Join Date: Oct 2008
Model: 8100
PIN: N/A
Carrier: Telus
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default pushscreen from menu problem

Please Login to Remove!

I am just getting started building BlackBerry apps. I am trying to launch a new screen from a menu item. I am using:

UiApplication.getUiApplication.pushScreen(new CacherAboutScreen())

where CacherAboutScreen is the screen I want to load up. The compiler is complaining with:

--------------------------
.....TitleScreen.java:19: cannot find symbol
symbol : variable getUiApplication
location: class net.rim.device.api.ui.UiApplication
UiApplication.getUiApplication.pushScreen(new CacherAboutScreen());
^
1 error
Error!: Error: java compiler failed:
------------------------------------

I have had this work in the past but cannot understand why it is failing now. The complete source of my screen is below. Any suggestions for a newbie are greatly appreciated.

Joe.

--------------------------------------------------
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;


public class TitleScreen extends MainScreen
{

public void makeMenu(Menu menu, int instance)
{

if (instance == Menu.INSTANCE_DEFAULT)
{
menu.add(new MenuItem("About", 10, 10)
{
public void run()
{
UiApplication.getUiApplication.pushScreen(new CacherAboutScreen());
}
});

}

super.makeMenu(menu, instance);
}

public TitleScreen()
{
super();
LabelField applicationTitle =
new LabelField("App title");
setTitle(applicationTitle);

}


}
Offline  
Old 10-02-2008, 02:44 PM   #2 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're missing a set of parenthesis...

Code:
UiApplication.getUiApplication.pushScreen(new CacherAboutScreen());
UiApplication.getUiApplication().pushScreen(new CacherAboutScreen());
Offline  
Old 10-02-2008, 03:00 PM   #3 (permalink)
New Member
 
Join Date: Oct 2008
Model: 8100
PIN: N/A
Carrier: Telus
Posts: 2
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank-you RemyJ. Such a dumb mistake to make. I won't make it again.

Thanks again.
Offline  
Old 10-02-2008, 05:42 PM   #4 (permalink)
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by joecord View Post
Thank-you RemyJ. Such a dumb mistake to make. I won't make it again.

Thanks again.
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.