Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 42
Registered: ‎10-23-2011
My Device: curve 8520
My Carrier: george najem
Accepted Solution

APPLICATION will not appear on main menu of simulator.. PLEASE HELP

[ Edited ]

Hello everybody ,

I came accross this code sample and tried to run it on the 9900 simulator and for some reason the simulator doesnt pick up the code. ..

 

as in the application does not appear on the main menu screen options.. so i can not launch it at all.

 

 

does anybody know why.. id really appriciate the help

 

(note: the code simple opens a new screen when a button is clicked)

 

kind regards

 

gezzy

package mypackage;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;

public class FirstScreen extends MainScreen implements FieldChangeListener {
	ButtonField theButton;

	public FirstScreen() {
		add(new LabelField("First Screen"));

		theButton = new ButtonField("New Screen", ButtonField.CONSUME_CLICK);

		theButton.setChangeListener(this);

		add(theButton);
	}

	public void fieldChanged(Field field, int context) {

		if (field == theButton) {
		UiApplication.getUiApplication().pushScreen(new SecondScreen());
		}

	}

	public class SecondScreen extends MainScreen {

		public SecondScreen() {
			add(new LabelField("Second Screen"));
		}
	}
}

 

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: APPLICATION will not appear on main menu of simulator.. PLEASE HELP

Is this the whole code? Where is your main class that extends UiApplication?
Contributor
Posts: 42
Registered: ‎10-23-2011
My Device: curve 8520
My Carrier: george najem

Re: APPLICATION will not appear on main menu of simulator.. PLEASE HELP

Yeah this is the entire code.

 

I didnt write it.. it was a sample somebody else made. I tried to add a UiApplication extension but i get errors anytime i do

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: APPLICATION will not appear on main menu of simulator.. PLEASE HELP

Thats why you don't see the icon. You'll need to add another class that extends UiApplication and has a main method. Have you looked at the sample applications?
Developer
Posts: 104
Registered: ‎04-15-2012
My Device: BlackBerry PlayBook with OS 2.0
My Carrier: N/A

Re: APPLICATION will not appear on main menu of simulator.. PLEASE HELP

I think you're telling that the application icon won't show up on the simulator? If so, this may help (I got the same problem and its what I did):

 

  1 Assuming you're using Eclipse, just run the program (it will package and show a loading icon for some seconds on the simulator).

  2 Then, go to File -> Load BlackBerry Application or Theme on the simulator.

  3 Navigate to your compiled COD file and open it.

  4 After a loading-icon, the application should show up in the menu.

 

If this doesn't work, try closing the simulator and do step 1.

 

Hope it will help!

My BlackBerry 10 apps: Roshnal Lihinikadu
Lots more coming up!
Contributor
Posts: 42
Registered: ‎10-23-2011
My Device: curve 8520
My Carrier: george najem

Re: APPLICATION will not appear on main menu of simulator.. PLEASE HELP

Thank you verry much for your help sir.. that helped verry much!!!!!

Developer
Posts: 104
Registered: ‎04-15-2012
My Device: BlackBerry PlayBook with OS 2.0
My Carrier: N/A

Re: APPLICATION will not appear on main menu of simulator.. PLEASE HELP

Glad to have helped you!! Maybe you can mark my post as the solution?
My BlackBerry 10 apps: Roshnal Lihinikadu
Lots more coming up!