I try to make live wallpaper for android, but i can’t get screen rotation, because lwp – it’s a service, not activity. I need integer value (0/90/180/270), not orientation (landscape/portraite), like if i’m call something like this:
((Activity) context).getResources().getConfiguration().orientation;
It is possible? I tried many ways and read many articles, but i can’t do it and can’t find helpful information.
Thanks!
So, i found the solution 🙂
But in my case it’s little bit buggy, don’t know why yet:
If you place your device to 0 degrees position (portrait orientation) and rotate to 180 degrees, nothing be detected, or from 90 to 270 and versa. But if you rotate your device from 0 to 90 or 270, or from 90 to 180 and 0 and so on – all is fine (different orientations).