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

Native Development

Reply
abx
Contributor
abx
Posts: 26
Registered: ‎10-03-2012
My Device: Playbook

Orientation events: navigator.h vs orientation.h

My app listens for orientation events through the navigator to handle portrait to landscape changes for which I update the buffer dimensions.  I listen for NAVIGATOR_ORIENTATION_CHECK and NAVIGATOR_ORIENTATION.

 

Do I also need to listen for ORIENTATION_INFO through orientation.h?   Isn't this redundant given what I do above?

 

Can you provide use-cases for listening to either or both of these events?

 

Thanks,

 

abx

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Orientation events: navigator.h vs orientation.h

Check this example https://github.com/blackberry/NDK-Samples/blob/master/GoodCitizen/main.c

It handles orrientation change events in proper way.

abx
Contributor
abx
Posts: 26
Registered: ‎10-03-2012
My Device: Playbook

Re: Orientation events: navigator.h vs orientation.h

We are having problems with:

 

    case NAVIGATOR_ORIENTATION_CHECK:
        //Signal navigator that we intend to resize
        flag = IsLandscape(event);
        navigator_orientation_check_response(event, flag);
        break;
 
    case NAVIGATOR_ORIENTATION:
        printf("we should not receive this event when not landscape");
 
We are responding with check_response (event, flag)  where flag is true if we are in landscape orientation.  We are seeing that sometimes we are getting NAVIGATOR_ORIENTATION despite having sent check_response(event, false)...
 
If we do some processing in NAVIGATOR_ORIENTATION, sometimes we are not receiving the NAVIGATOR_ORIENTATION_CHECK future events at all.  There seems to be a jira ticket:  tablet-362 that describes this issue...   But that was for sdk1.x
 
 
Any ideas?