×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    HandleResourceChangeL() beheviour differently on Eumulator and phone

    hi,

    i got different result when using HandleResourceChangeL() on Emulator and Phone.

    in my application. i need to set the orientation mode to portrait then handle orientation mode change event in
    HandleResourceChangeL().
    So i used SetOrientation() function to force application to portrait mode. Then i observed the beheviour of handleResourceChangeL().

    On Emulator I debuged into handleResourceChangeL() after SetOrientation().
    On phone the handleResourceChangeL() was never invoked again after SetOrientation().
    if i disable SetOrientation() i got into handleResourceChangeL() in both cases.

    I assume handleResourceChangeL() beheviour differently on Eumulator and phone. anyone have got the same problem?

    Can anyone tell me if i am thinking in the right way?

    Thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    Have you considered the other variant? HandleResourceChangeL is the method which works, and SetOrientation is the one which does not work on the emulator.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    Quote Originally Posted by wizard_hu_ View Post
    Have you considered the other variant? HandleResourceChangeL is the method which works, and SetOrientation is the one which does not work on the emulator.
    Thank ,could you give some more information of 'other variant'

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    Quote Originally Posted by Zhuwei View Post
    Thank ,could you give some more information of 'other variant'
    I already did, that was the second sentence in my two-sentence post. It also appears in yours since you have quoted it without modification.

    But here it is once more:
    - SetOrientation can not force the orientation of the emulator, it may set the orientation variable, which you can retrieve using Orientation, but the content of the screen will not change. Because you have tried to force portrait orientation, you probably did not expected any change, but I can assure you that nothing will happen if you try setting landscape orientation
    - thus HandleResourceChangeL always gets invoked.

  5. #5
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    Quote Originally Posted by wizard_hu_ View Post
    I already did, that was the second sentence in my two-sentence post. It also appears in yours since you have quoted it without modification.

    But here it is once more:
    - SetOrientation can not force the orientation of the emulator, it may set the orientation variable, which you can retrieve using Orientation, but the content of the screen will not change. Because you have tried to force portrait orientation, you probably did not expected any change, but I can assure you that nothing will happen if you try setting landscape orientation
    - thus HandleResourceChangeL always gets invoked.
    So do you mean it is not possible to observe screen orentation mode using HandleResourceChangeL after SetOrientation() on phone???
    if yes, are there some other ways to do this?????

    Thanks

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    It is normal. Since you fixed your orientation to portrait, your orientation will remain portrait, independently from whatever happens with the device. If something does not change, it is pretty obvious that you will not get notification about its changes.

  7. #7
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    Quote Originally Posted by wizard_hu_ View Post
    It is normal. Since you fixed your orientation to portrait, your orientation will remain portrait, independently from whatever happens with the device. If something does not change, it is pretty obvious that you will not get notification about its changes.
    Thank you

    i need to display a message when user switches device to landscape mode to tell him landscape is not supported since i forced the screen mode to portrait.

    this is a reasonable request. isn't it?
    there is no way to realize it except HandlResourceChangeL()??

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    Now I understand. Unfortunately I do not know if it is possible or not.
    There are things you can try, like checking the events at a bit lower level, in AppUi::HandleWsEventL, just do not forget passing the events to the parent class. Even more lower level could be having an own RWsSession, and using EventReady+GetEvent in an active object.

  9. #9
    Registered User
    Join Date
    Oct 2008
    Posts
    17

    Re: HandleResourceChangeL() beheviour differently on Eumulator and phone

    Quote Originally Posted by wizard_hu_ View Post
    Now I understand. Unfortunately I do not know if it is possible or not.
    There are things you can try, like checking the events at a bit lower level, in AppUi::HandleWsEventL, just do not forget passing the events to the parent class. Even more lower level could be having an own RWsSession, and using EventReady+GetEvent in an active object.
    i tried with HandleWsEventL, the same beheviour
    what is name of the function which lower than HandleWsEventL??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×