Android Question Detect device orientation in background service

Discussion in 'Android Questions' started by daemon, Jan 20, 2015.

  1. daemon

    daemon Active Member Licensed User

    How can I detect device orientation in a background service that is configured to start at boot (i.e. none of my activities have run)?

    I also need to get events when the orientation changes, so that I can start using new orientation.

    Update: I tried using PhoneOrientation, but since my device does not have orientation sensor, I never received OrientationChanged event.
    Last edited: Jan 20, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. daemon

    daemon Active Member Licensed User

    I want to know exact rotation (0, 90, 180, 270) of device, even when it is in locked state.
    Display orientation does not seem to change in locked state.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice