BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 10-02-2008, 02:33 PM   #1
joecord
New Member
 
Join Date: Oct 2008
Model: 8100
PIN: N/A
Carrier: Telus
Posts: 2
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
RemyJ
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
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
joecord
New Member
 
Join Date: Oct 2008
Model: 8100
PIN: N/A
Carrier: Telus
Posts: 2
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
RemyJ
CrackBerry Addict
 
Join Date: May 2005
Location: Golden, CO US
Model: 9700
Carrier: ATT
Posts: 684
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


686022 - COIL,ORANGE 220 picture

686022 - COIL,ORANGE 220

$40.99



KG105-14100 IGNITION COIL For Kipor 2000/2600 picture

KG105-14100 IGNITION COIL For Kipor 2000/2600

$28.34



NEW 12V COIL W / INTERNAL RESISTOR picture

NEW 12V COIL W / INTERNAL RESISTOR

$21.99



Ignition Coil For Briggs And Stratton 395491 397358; IBS3002 picture

Ignition Coil For Briggs And Stratton 395491 397358; IBS3002

$40.22



Heating Coil 5 PIN XLR 20mm 16mm 10mm flat 25mm 30mm Electronic picture

Heating Coil 5 PIN XLR 20mm 16mm 10mm flat 25mm 30mm Electronic

$39.99







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