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
Developer
Posts: 88
Registered: ‎02-11-2009
My Device: Not Specified

Screen orientation

HI All,

 

i have on issue regarding screen orienation.In My App when i changed screen orientation from landscape to portrait  or portrait to landscape it throgh Null pointer Exception.

 

 

Thanks,

 

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Screen orientation

Do you have any layout/sublayout override in your code?

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Highlighted
Developer
Posts: 88
Registered: ‎02-11-2009
My Device: Not Specified

Re: Screen orientation

Hi,

 

yes i override layout method in Titlefield component that used in My App.

 

 

Thanks,

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Screen orientation

And does it analyze the width and the height passed to it? Does it, say, choose an image according to those values?

 

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!
Developer
Posts: 88
Registered: ‎02-11-2009
My Device: Not Specified

Re: Screen orientation

below layout method i used.

 

 protected void layout(int width, int height)
    {
        setExtent(getPreferredWidth(), getPreferredHeight());
    }

Developer
Posts: 2,268
Registered: ‎07-08-2009
My Device: various
My Carrier: various

Re: Screen orientation

No, that's not it...

Well, NullPointerException means (naturally) that you tried to use something that is not initialized to a valid Object. Can you debug and see which line trows the exception? You should be able to examine the variables in the debugger and see which one is null.

----------------------------------------------------------
please click 'Accept Solution' on posts that provide the solution to the question you've posted. Don't say "Thanks", press 'Like' button instead!