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: 146
Registered: ‎11-05-2008
My Device: Not Specified

the orientation listener for Storm

Hi,

There is any listener,when i am changing the orientation of BB(Storm)?.So how can i understand the screen is in landscape or portrait mode?Please help me

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: the orientation listener for Storm

Simple method: You can look at Display.getWidth() and Display.getHeight() to determine the current orientation.

 

Or, you can use the Accellerometer interface. See the API docs.

 

Developer
Posts: 146
Registered: ‎11-05-2008
My Device: Not Specified

Re: the orientation listener for Storm

Actually I want,whenever BB device will rotate ,my application will be lisetened.So for this case is there any RIM istener?

or  I will check all the time in seperate thread,the current width and height of scrren.In this way u r saying to do it.?

Developer
Posts: 163
Registered: ‎07-16-2008
My Device: Not Specified
My Carrier: Sprint

Re: the orientation listener for Storm

Sublayout gets called on the managers when the orientation changes.  Override sublayout to do what you want. 
Andrew Cowart | Metova
www.metova.com
Developer
Posts: 146
Registered: ‎11-05-2008
My Device: Not Specified

Re: the orientation listener for Storm

Thanx for you help.But another problem i m facing,that animation (Rotation)doesn't occurring from LandScape mode to portrait mode or vice versa.I m using storm9500.How can it will be possible? 

Highlighted
BlackBerry Development Advisor
Posts: 15,809
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: the orientation listener for Storm

What animation are you referring to?  Is this an action your application performs?
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.