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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:25:33+00:00 2026-05-22T23:25:33+00:00

I am a bit perplexed on what Android holds onto in a view orientation

  • 0

I am a bit perplexed on what Android holds onto in a view orientation change and what it doesn’t.

Some things it seems it holds onto nicely, other things it seems it doesn’t.. So I am not sure if it is my code, or something else. (I assume I am doing something stupid)

What I have is a view with a listview in it, the listview has a simple adapater and an array of map items to put into the listview.

When the orientation changes, I know that the activity is destroyed and recreated, so I assume that my simple adapater and its tie to the listview are gone.. so the listview won’t rotate populated and I’ll need to use the onRetainNonConfigurationInstance or onSaveInstanceState methods to pass through either the adapter or the list of values?

This seems excessive, I can’t believe the sharp guys at Google don’t have an easier way to handle this.. The listview has an ID, and after orientation I can add items to it and it works fine, but it just doesn’t hold onto the values it had before.

Is my only way around this to pass the list content through explicitely? Is it the fact I am creating a new SimpleAdapter and linking it to the list in the onCreate that is causing the issue? Or is it the fact the array of Items I have linked to the adapter is whiped out when the activity is?? This seems like something that shouldn’t require this much work to accomplish.. am I missing something?

  • 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-22T23:25:34+00:00Added an answer on May 22, 2026 at 11:25 pm

    No, you could also have a persistent model through Activity lifecycle like this :

    define a singleton app, with a method to get your singleton model.

    At on create get your datas from your model.

    As your model will no be recreated but will persist, this can be used as a workaround for preserving objets through rotation change.

    Regards,
    Stéphane

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

Sidebar

Related Questions

Being a bit perplexed about this issue by now, I hope some of you
I am a bit perplexed by the Boost ublas documentation. It does not seem
I'm a bit perplexed by drag and drop in wxPython (but perhaps this questions
I am a bit perplexed on how to catch a specific error type of
Bit rusty on the sql side as I have not touched in a while
Bit of a random one, i am wanting to have a play with some
Bit of a strange question. I have a website which has some pages in
Bit of an issue as to not knowing which is the best way to
I'm making my constructors a bit more strict by removing some of my empty
Bit of a complex one here, not sure if it is possible. Below is

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.