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
Regular Contributor
Posts: 61
Registered: ‎08-11-2010
My Device: Not Specified
Accepted Solution

Screen loads on simulator but not on device

Hi all,

          This issue is driving me crazy.

The problem: I have added a menu item in the email App. When the user clicks on the menu, I load a popup screen and get user input and save it. This works absolutely fine on my simulator (8310 v4.5). But when i load it in my device (8310 v4.5), it doesn't.

         I am unable to figure out where the problem is. Your inputs please.

 

Note: I have checked with the menu item registration. I added an alert msg before loading the screen. The alert appears, whereas the screen doesn't load. (The screen is a seperate class in the same menuitem class file, which I instantiaite inside the run() method of the application menuitem).

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Screen loads on simulator but not on device

Debug on device.

Regular Contributor
Posts: 61
Registered: ‎08-11-2010
My Device: Not Specified

Re: Screen loads on simulator but not on device

i am sorry peter, but i am not aware of this option. could you provide me any lead as to how i should go about this?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Screen loads on simulator but not on device

Sorry I was in a hurry, so only wrote a very brief response.  Unusual for me!

 

Have a look at this:

http://supportforums.blackberry.com/t5/Java-Development/How-Do-I-Debug-on-a-Live-Device/ta-p/446842

 

There are other tips on the forum which you will probably find by searching, should this not help. 

Regular Contributor
Posts: 61
Registered: ‎08-11-2010
My Device: Not Specified

Re: Screen loads on simulator but not on device

Thanks Peter. This is such a wonderful option!! :-) thanks a lot

Developer
Posts: 237
Registered: ‎07-20-2010
My Device: Not Specified

Re: Screen loads on simulator but not on device

[ Edited ]

I just ran into this issue. 

I am using  v5.0 and   v6.0 simulators and testing on a v6.0 device (Telus 9780).   Debuging on the device shows the problem turned out to be a NullPointerException being thrown where I was adding something to a VerticalFieldManager

   private VerticalFieldManager buttonholder = new VerticalFieldManager();

and lateractually in  the constructor:

        innerMain.add(buttonholder);

 

Innermain has had other stuff added to it by the time that code runs so it is definetly not null.  it is another VerticalFieldManager.

 

Has anyone else had trouble like this on v6.0 devices?

 

PS: Digging deeper using a new simulator (T-Mobile US 9780)  I found that the device does not support the virtual keyboard so related api's return null or throw the exception.  ( I had thought all 4.7+ devices would support the virtual keyboard)  Surrounding such code with try/catch blocks (just eat the exception) stiffles the bug till I get around to branching the code.