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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:20:41+00:00 2026-06-09T09:20:41+00:00

I have a simple Android app with one Activity. This Activity downloads a small

  • 0

I have a simple Android app with one Activity. This Activity downloads a small XML file and displays the contents to the user. Currently I kick-off the download in the Activity’s onStart method.

It’s my understanding that Activities are destroyed and re-created when the device orientation changes. So when users rotate my app the XML file is downloaded again. I’d like the app to download the file just once as it doesn’t change more than a few times per day. Hence I’d like some object to retain the downloaded data so the local data can be re-used when the device orientation changes. What’s the ideal object in Android to retain the data?

On iOS I’d use the AppDelegate to download the data once and retain it. Then the viewController that displays the data can just re-use the local data should it be destroyed and re-created.

  • 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-09T09:20:42+00:00Added an answer on June 9, 2026 at 9:20 am

    I’m assuming you’ve seen this page:

    http://developer.android.com/guide/topics/data/data-storage.html#pref

    Depending on the kind of data from the XML file (if it’s fairly simple data), using “Shared Preferences” could be a simple way to go. You could rewrite the new data from XML when you need to while still being able to use it from the shared preferences.

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

Sidebar

Related Questions

I have this code: package lijap.app.starcraft2counters; import java.io.File; import android.app.Activity; import android.os.Bundle; import android.os.Environment;
I have created a small and simple android app. I tried installing it on
I have a simple android app to play videos. I have a main screen
I have a simple question. I am trying to design a simple Android app,
I'm working on a relatively simple Android app. I want it to have an
I have a very simple dialog defined as: import android.app.AlertDialog; import android.content.Context; import android.view.LayoutInflater;
I have a simple client-server app on android. the android service communicates with the
I have a simple Android.mk file: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) $(shell ($(LOCAL_PATH)/echo_test.sh))
So I have a very simple android activity that starts a timer when you
Booking.java package one.two; import android.app.Activity; import android.database.Cursor; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.SimpleCursorAdapter; import

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.