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 3433720
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:36:38+00:00 2026-05-18T07:36:38+00:00

I read a lot about handling rotation in android applications, but I still have

  • 0

I read a lot about handling rotation in android applications, but I still have so many questions and need to much to understand.

Let me explain my problem or implementation, that I’m using now in my application.

If an activity will be opened, a get request will be sent to server. This request will be executed in a Thread (new Thread(…)) and if request was completed, activity’s ui will be refreshed.

But what should I do, if the user rotate his device?

By default, the activity will be destroyed and request will be started again and start a new thread, but the thread of destroyed activity may be still running.

I guess, it’s a quite wrong way, I have now.

But what is the best approach, to handle this?

Probably is the best way to forbid rotation, but what If I don’t want that?!

May be it’s the second part of my question:

I saw a video form Google IO. Mr. Dobjanschi suggested to use services and to store retrieved data in content provider. So, probably I can use a service for executing my requests. But should data be replaced every time the get request was completed?!

  • 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-18T07:36:39+00:00Added an answer on May 18, 2026 at 7:36 am

    Well dont know exactly how its done, You can try saving the instance and retrieving the same when config changes with following methods:

    I have read about them but haven’t really implemented them yet. I hope it can give you some start.

    @Override
    public Object onRetainNonConfigurationInstance() {
    return(myServerThread);
    }
    
    private void restoreServerFunctions() {
    if (getLastNonConfigurationInstance()!=null) {
    myServerThread=(Thread)getLastNonConfigurationInstance();
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read a lot about this issue but mine still seems to be
I have read a lot about unit testing, but I still haven't found any
I have read a lot about this! But I can't make a clear idea!
I have read a lot about MVC design pattern, but some of the things
I'he read a lot about this but still i am unclear about the things.
I have read a lot about accessing files in an iPhone app, but I
I have read a lot about projective geometry and cross ratio, but I don´t
I've read a lot about the question but the answers I have found don't
I have read a lot about the clear cache command for symfony2, but I
I have read a lot about this topic, and still I don't have the

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.