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


NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L CERAMIC BEARINGS  picture

NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L CERAMIC BEARINGS

$80.75



Dentistry Replacement NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L NEW picture

Dentistry Replacement NSK TiMAX NL95M/ A500/ A500L/ AK500L/ AS500L /AW500L NEW

$79.95



A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board picture

A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board

$350.00



1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



New Greaseweazle V4.1 USB Floppy Adapter Flux Reader Writer Amiga Atari ST 1591 picture

New Greaseweazle V4.1 USB Floppy Adapter Flux Reader Writer Amiga Atari ST 1591

$28.23



MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220 picture

MITSUBISHI FR-A820 1.5K TFA INVERTER A500 240 V #L-220

$684.00







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