Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8801573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:52:13+00:00 2026-06-14T00:52:13+00:00

I try to make live wallpaper for android, but i can’t get screen rotation,

  • 0

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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:52:14+00:00Added an answer on June 14, 2026 at 12:52 am

    So, i found the solution 🙂

    public int getRotation() {
        int orientation = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getOrientation();
    
        switch (orientation) {
            case Surface.ROTATION_90:  return 90;
            case Surface.ROTATION_180: return 180;
            case Surface.ROTATION_270: return 270;
            default: return 0;
        }
    }
    

    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).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to make something like live type using html5 canvas, but I can't
I try to make a apps that need barcode scanner, i already can get
I've decided to try to make a little Android application that streams live audio
I try to make an animation with an image in my view but it
I try to make an Android application which communicates with a non-standard ISO15693 (NFC-V)
I am using Jeditable, http://www.appelsiini.net/projects/jeditable And DataTables, http://datatables.net/download/ To try and make an live
I'm trying to make an app that plays live http streaming on android (i
I'm trying to copy the server example from http://live.gnome.org/Vala/GIONetworkingSample . But when I try
I am building a simple live wallpaper for Android. I am uploading the required
// for example $('#text').die('focusout'); //then I try to make it live() with a button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.