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


IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM picture

IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM

$2.99



IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360 picture

IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360

$18.00



IBM Selectric Part OEM 1141763 13

IBM Selectric Part OEM 1141763 13" Velocity Cable

$13.45



Genuine IBM Selectrric Motor Bushing 10 Pack OEM  P/N 1236572 picture

Genuine IBM Selectrric Motor Bushing 10 Pack OEM P/N 1236572

$7.99



IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259 picture

IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259

$24.79



OEM  IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working picture

OEM IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working

$34.99







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