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

  • Home
  • SEARCH
  • 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 7616939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:00:53+00:00 2026-05-31T03:00:53+00:00

Here is the thing. I do need to do a long process after my

  • 0

Here is the thing. I do need to do a long process after my MapActivity is started, I have a lot of GeoPoints to add to the map. Everything works fine, but I want to display a ProgressDialog, while my AsyncTask does the job in the background, so the user actually knows that something happens in that few seconds. Again, everything works just fine, until I rotate the phone while the ProgressDialog is alive. No problem I thought, I already dealed with this in another Activity, so I will just pass the Activity to the AsyncTask, which will then invoke the following line before the dialog is shown, so the Context in which I am showing the dialog, wont get destroyed prematurely thus producing a force close:

activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);

…and I will just invoke this line after my dialog is dismissed:

activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);

…so the user can rotate his phone again. Here comes my problem: it just won’t work in a MapActivity, it will produce a NullPointerException on the NOSENSOR line. Is there any other way to temporarily disable rotation in MapActivities? I might just fix the whole thing to “portrait”, but that is not what I want to do, if I could do it better.

cheers

  • 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-05-31T03:00:54+00:00Added an answer on May 31, 2026 at 3:00 am

    To handle the configuration(like orientation change) yourself. Add this to your manifest

    android:configChanges="orientation|keyboardHidden"
    

    in the activity tag.

    Then you can handle these config changes by putting following method to your activity

    @Override
    public void onConfigurationChanged(Configuration config){
        super.onConfigurationChanged(config);
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the need to kick off a long-running process in response to a
I need some help with floating point numbers...please! Here's the thing, I have code
Here's the thing: I have two applications, written in C++ and running on two
Here is the thing. Right now I have this e-commerce web site where people
Here is the thing. I currently have a tabBar controller, with several navigation controllers
I Have a problem... Here's the deal. I have a lot of elements and
I have search for a long time to get this thing work. What I
I have some database table and need to process records from it 5 at
so, here is the thing, I need to run .jar I've programmed myself on
Here's the thing. I have an interface, and I would to put the Include

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.